mirror of git://git.psyced.org/git/pypsyc
43 lines
1.1 KiB
Python
Executable File
43 lines
1.1 KiB
Python
Executable File
#!/usr/bin/env python
|
|
"""
|
|
:copyright: 2010 by Manuel Jacob
|
|
:license: MIT
|
|
"""
|
|
import logging
|
|
logging.basicConfig()
|
|
from optparse import OptionParser
|
|
from os import path, mkdir
|
|
|
|
|
|
def main():
|
|
parser = OptionParser()
|
|
parser.add_option('-c', '--config', dest='config_dir',
|
|
default=path.expanduser(path.join('~', '.pypsyc')))
|
|
options, args = parser.parse_args()
|
|
|
|
if not path.exists(options.config_dir):
|
|
mkdir(options.config_dir)
|
|
|
|
accounts_file = path.join(options.config_dir, 'accounts')
|
|
if not path.exists(accounts_file):
|
|
with open(accounts_file, 'w') as f:
|
|
f.write('[]')
|
|
|
|
from twisted.internet import gtk2reactor
|
|
gtk2reactor.install()
|
|
|
|
from pypsyc.client.controller import MainController
|
|
from pypsyc.client.model import Client
|
|
from pypsyc.client.view import MainView
|
|
|
|
model = Client(accounts_file=accounts_file)
|
|
view = MainView()
|
|
MainController(model, view)
|
|
model.load_accounts()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|
|
from twisted.internet import reactor
|
|
reactor.run()
|