Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(574)

Side by Side Diff: bin/tryton

Issue 140069: patch for issue 1030 - redirect stout and stderr on windows (Closed)
Patch Set: close stderr and stdout Created 14 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 # True only if running as a py2exe app
12 if os.name == 'nt' and hasattr(sys, "frozen"):
13 ····
14 class NoWhere(object):
15 softspace = 0
16 def write(self, text):
17 pass
18 def flush(self):
19 pass
20
21 sys.stdout = NoWhere()
ced1 2009/11/08 10:30:16 Why not: sys.stdout = open(os.devnull, 'w')
22 sys.stderr = NoWhere()
23 del NoWhere
24
11 if os.name == 'mac' or \ 25 if os.name == 'mac' or \
12 (hasattr(os, 'uname') and os.uname()[0] == 'Darwin'): 26 (hasattr(os, 'uname') and os.uname()[0] == 'Darwin'):
13 resources = os.path.join(os.path.dirname(sys.argv[0]), '..', 'Resources') 27 resources = os.path.join(os.path.dirname(sys.argv[0]), '..', 'Resources')
14 gtkrc = os.path.join(resources, 'gtkrc') 28 gtkrc = os.path.join(resources, 'gtkrc')
15 pixbuf_loader = os.path.join(resources, 'gdk-pixbuf.loaders') 29 pixbuf_loader = os.path.join(resources, 'gdk-pixbuf.loaders')
16 pangorc = os.path.join(resources, 'pangorc') 30 pangorc = os.path.join(resources, 'pangorc')
17 if os.path.isdir(resources): 31 if os.path.isdir(resources):
18 os.environ['GTK2_RC_FILES'] = gtkrc 32 os.environ['GTK2_RC_FILES'] = gtkrc
19 os.environ['GTK_EXE_PREFIX'] = resources 33 os.environ['GTK_EXE_PREFIX'] = resources
20 os.environ['GTK_DATA_PREFIX'] = resources 34 os.environ['GTK_DATA_PREFIX'] = resources
21 os.environ['GDK_PIXBUF_MODULE_FILE'] = pixbuf_loader 35 os.environ['GDK_PIXBUF_MODULE_FILE'] = pixbuf_loader
22 os.environ['PANGO_RC_FILE'] = pangorc 36 os.environ['PANGO_RC_FILE'] = pangorc
23 37
24 import tryton.client 38 import tryton.client
25 tryton.client.TrytonClient().run() 39 tryton.client.TrytonClient().run()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b