Left: | ||
Right: |
OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 import sys, os | 2 import sys, os |
3 try: | 3 try: |
4 DIR = os.path.abspath(os.path.normpath(os.path.join(__file__, | 4 DIR = os.path.abspath(os.path.normpath(os.path.join(__file__, |
5 '..', '..', 'tryton'))) | 5 '..', '..', 'tryton'))) |
6 if os.path.isdir(DIR): | 6 if os.path.isdir(DIR): |
7 sys.path.insert(0, os.path.dirname(DIR)) | 7 sys.path.insert(0, os.path.dirname(DIR)) |
8 except: | 8 except: |
9 pass | 9 pass |
10 | 10 |
11 if os.name == 'nt': | |
ced1
2009/11/05 12:57:22
It should be done only when embedded in py2exe
timitos
2009/11/05 19:39:36
new patchset uploaded. should fix that.
| |
12 if not os.path.isdir(os.path.join(os.environ['APPDATA'],"Tryton")): | |
13 os.makedirs(os.path.join(os.environ['APPDATA'],"Tryton")) | |
14 sys.stdout = open(os.path.join(os.environ['APPDATA'],"Tryton","tryton_stdout .log"), "a") | |
15 sys.stderr = open(os.path.join(os.environ['APPDATA'],"Tryton","tryton_stderr .log"), "a") | |
16 | |
11 if os.name == 'mac' or \ | 17 if os.name == 'mac' or \ |
12 (hasattr(os, 'uname') and os.uname()[0] == 'Darwin'): | 18 (hasattr(os, 'uname') and os.uname()[0] == 'Darwin'): |
13 resources = os.path.join(os.path.dirname(sys.argv[0]), '..', 'Resources') | 19 resources = os.path.join(os.path.dirname(sys.argv[0]), '..', 'Resources') |
14 gtkrc = os.path.join(resources, 'gtkrc') | 20 gtkrc = os.path.join(resources, 'gtkrc') |
15 pixbuf_loader = os.path.join(resources, 'gdk-pixbuf.loaders') | 21 pixbuf_loader = os.path.join(resources, 'gdk-pixbuf.loaders') |
16 pangorc = os.path.join(resources, 'pangorc') | 22 pangorc = os.path.join(resources, 'pangorc') |
17 if os.path.isdir(resources): | 23 if os.path.isdir(resources): |
18 os.environ['GTK2_RC_FILES'] = gtkrc | 24 os.environ['GTK2_RC_FILES'] = gtkrc |
19 os.environ['GTK_EXE_PREFIX'] = resources | 25 os.environ['GTK_EXE_PREFIX'] = resources |
20 os.environ['GTK_DATA_PREFIX'] = resources | 26 os.environ['GTK_DATA_PREFIX'] = resources |
21 os.environ['GDK_PIXBUF_MODULE_FILE'] = pixbuf_loader | 27 os.environ['GDK_PIXBUF_MODULE_FILE'] = pixbuf_loader |
22 os.environ['PANGO_RC_FILE'] = pangorc | 28 os.environ['PANGO_RC_FILE'] = pangorc |
23 | 29 |
24 import tryton.client | 30 import tryton.client |
25 tryton.client.TrytonClient().run() | 31 tryton.client.TrytonClient().run() |
OLD | NEW |