fixed ru.po, up version to 0.3.1
[multilist] / src / multilist
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3   
4 """
5     This file is part of Multilist.
6
7     Multilist is free software: you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation, either version 3 of the License, or
10     (at your option) any later version.
11
12     Multilist is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.
16
17     You should have received a copy of the GNU General Public License
18     along with Multilist.  If not, see <http://www.gnu.org/licenses/>.
19     
20     Copyright (C) 2008 Christoph Würstle
21 """
22
23 import os
24 import sys
25
26 ##
27 ## I18N
28 ##
29 import locale
30 import gettext
31 gettext.install('multilist', unicode=1)
32                         
33 if __name__ == "__main__":
34         
35         try:
36                 import tempfile
37                 import gtk
38                 tmpdir=tempfile.gettempdir()
39                 
40                 os.mkdir(os.path.join(tmpdir, "multilist_lock"))
41         except OSError:
42                 ## Failed: another instance is running
43                 
44                 mbox=gtk.MessageDialog(None,gtk.DIALOG_MODAL,gtk.MESSAGE_ERROR,gtk.BUTTONS_YES_NO,_("Multilist is already running. Start anyway? (Could result in db problems!)")) 
45                 response=mbox.run() 
46                 mbox.hide() 
47                 mbox.destroy() 
48                 if response==gtk.RESPONSE_NO:
49                         sys.exit()
50
51         try:
52                 
53                 from multilistclasses import libmultilist
54                 #print dir(eggtimerclasses)
55                 app = libmultilist.multilistclass() 
56                 app.main() 
57    
58         finally:
59                 ## Remove the PID file
60                 # (...)
61                 ## Delete directory
62                 os.rmdir(os.path.join(tmpdir, "multilist_lock"))
63                 
64