-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwarmachine
More file actions
executable file
·40 lines (35 loc) · 1.2 KB
/
warmachine
File metadata and controls
executable file
·40 lines (35 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python
import sqlite3
from wmd.irc import IRC
import settings
if __name__ == '__main__':
connection = sqlite3.connect(settings.DB_PATH)
c = connection.cursor()
# check to see if a table exists
is_installed = bool(c.execute("SELECT name FROM sqlite_master WHERE "
"type='table' AND name='warmachine_settings'"
).fetchone()
)
if not is_installed:
c.execute("""CREATE TABLE warmachine_settings (
key text,
value text,
plugin text,
primary key (key, plugin)
);
""")
c.execute("""CREATE TABLE warmachine_plugins (
id text,
name text,
description text,
is_active int,
primary key (id)
);
""")
i = IRC(settings.SERVER, settings.NICKNAME, settings.IDENT,
settings.PASSWORD, settings.PORT,)
i.connect()
import time; time.sleep(10)
for channel in settings.CHANNELS:
i.join(channel)
i()