Forgot to add the SettingsDialog.py file when commiting the previous push.
[wixi.git] / wixi.py
blobb70fbaf1468d2652bbc57fc1dd72bf690f2042b4
1 #!/usr/bin/python
3 # Copyright (C) 2007 k.remmelzwaal@planet.nl
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 import wx, sys, os, getopt
20 import wixi
22 version = '1.05'
23 showhelp = '''Wixi %s (c) 2006-2008 k.remmelzwaal@planet.nl
24 Options:
25 -r <dir> --repository=<dir> (repository containing wiki's)
26 -w <wiki> --wiki=<wiki> (start with a specific wiki)
27 -g <geom> --geometry=<geom> (window width and height, default=850x550)
28 -v --viewmode (view only mode)
30 --navpanel=<left|off|right> (disable or align category/search panel, default=left)
31 --iconsize=<small|large> (select the size for icons, default=large (gtk))
32 ''' % (version)
35 def RunApp():
37 #for path in sys.path:
38 # if path[-14:] == "/site-packages":
39 # icondir = path + "/wixi/icons/"
41 icondir = os.getcwd() + "/wixi/icons/"
42 options.update({'icondir': icondir})
45 if options.get('viewmode'):
46 app = wx.PySimpleApp()
47 main = wixi.MainFrame.ViewFrame(None, -1, "Wixi - " +version, options)
48 app.MainLoop()
49 else:
50 app = wx.PySimpleApp()
51 main = wixi.MainFrame.MainFrame(None, -1, "Wixi - " +version, options)
52 app.MainLoop()
54 if __name__ == '__main__':
56 global options
57 options, needhelp = {'navpanel':'left','iconsize':'22x22','viewmode':False}, False
59 try:
60 optlist, args = getopt.getopt(sys.argv[1:], 'r:w:g:v',['navpanel=','repository=','iconsize=','geometry=','wiki=','viewmode'])
62 for opt, arg in optlist:
64 if opt in ("-r","--repository"): options.update({'repository': arg})
65 if opt in ("-v","--viewmode"): options.update({'viewmode': True})
66 if opt in ("-w","--wiki"): options.update({'wiki': arg})
67 if opt in ("-g","--geometry"):
68 width = int(arg.split('x')[0])
69 height = int(arg.split('x')[1])
70 options.update({'geometry': (width,height)})
71 if opt == "--navpanel": options.update({'navpanel':arg})
72 if opt == "--iconsize":
73 if arg == "small": options.update({'iconsize':'16x16'})
74 else: options.update({'iconsize':'22x22'})
76 except: needhelp = True
78 if needhelp: print showhelp
79 else: RunApp()