summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--settings.py2
-rwxr-xr-xwarmachine25
2 files changed, 27 insertions, 0 deletions
diff --git a/settings.py b/settings.py
index f0c930e..bdb1e17 100644
--- a/settings.py
+++ b/settings.py
@@ -15,6 +15,8 @@ CHANNELS = ('#warmachine-dev',)
15 15
16ADMINS = ('com4',) 16ADMINS = ('com4',)
17 17
18DB_PATH = "warmachine.db"
19
18ACTIONS = ( 20ACTIONS = (
19 'wmd.actions.passive.nickserv.IdentWithNickserv', 21 'wmd.actions.passive.nickserv.IdentWithNickserv',
20 'wmd.actions.passive.pong.RespondToPing', 22 'wmd.actions.passive.pong.RespondToPing',
diff --git a/warmachine b/warmachine
index d44f0c1..e4a461a 100755
--- a/warmachine
+++ b/warmachine
@@ -1,8 +1,33 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2import sqlite3
3
2from wmd.irc import IRC 4from wmd.irc import IRC
3import settings 5import settings
4 6
5if __name__ == '__main__': 7if __name__ == '__main__':
8 connection = sqlite3.connect(settings.DB_PATH)
9 c = connection.cursor()
10
11 # check to see if a table exists
12 is_installed = bool(c.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='warmachine_settings'").fetchone())
13 print is_installed
14 if not is_installed:
15 c.execute("""CREATE TABLE warmachine_settings (
16 key text,
17 value text,
18 plugin text,
19 primary key (key, plugin)
20 );
21 """)
22 c.execute("""CREATE TABLE warmachine_plugins (
23 id text,
24 name text,
25 description text,
26 is_active int,
27 primary key (id)
28 );
29 """)
30
6 i = IRC(settings.SERVER, settings.NICKNAME, settings.IDENT, settings.PORT) 31 i = IRC(settings.SERVER, settings.NICKNAME, settings.IDENT, settings.PORT)
7 i.connect() 32 i.connect()
8 for channel in settings.CHANNELS: 33 for channel in settings.CHANNELS: