summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-08-27 14:08:50 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-08-27 14:08:50 +0200
commit97d12b24002c0f8843be7db0eb1db4003786b691 (patch)
tree68d3e3722034a3aa0dc11100ce7c71e46e4ce037
parentdac2a378003f09dcbe12b27dcf15a47ab9bac46a (diff)
downloadportato-97d12b24002c0f8843be7db0eb1db4003786b691.tar.gz
portato-97d12b24002c0f8843be7db0eb1db4003786b691.tar.bz2
portato-97d12b24002c0f8843be7db0eb1db4003786b691.zip
Only import stuff if necessary
Diffstat (limited to '')
-rw-r--r--portato/__init__.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/portato/__init__.py b/portato/__init__.py
index 7363429..44a4da4 100644
--- a/portato/__init__.py
+++ b/portato/__init__.py
@@ -14,13 +14,10 @@ from __future__ import absolute_import
import gettext, locale
import sys, os
-import subprocess, threading
-import atexit
from optparse import OptionParser, SUPPRESS_HELP
from .log import start as logstart
from .constants import LOCALE_DIR, APP, VERSION
-from .su import detect_su_command
from .helper import debug, info, error
# listener-handling
@@ -62,8 +59,7 @@ def _sub_start ():
def start():
# set gettext stuff
- locale.setlocale(locale.LC_ALL, '')
- gettext.install(APP, LOCALE_DIR, unicode = True)
+ _sub_start()
# start logging
logstart(file=False)
@@ -71,10 +67,12 @@ def start():
# run parser
(options, args) = get_parser().parse_args()
- # close listener at exit
- atexit.register(get_listener().close)
-
if options.nofork or os.getuid() == 0: # start GUI
+
+ # close listener at exit
+ import atexit
+ atexit.register(get_listener().close)
+
logstart(file = True) # start logging to file
from .gui import run
@@ -90,6 +88,8 @@ def start():
else: # start us again in root modus and launch listener
from . import ipc
+ import subprocess, threading
+ from .su import detect_su_command
mq = ipc.MessageQueue(None, create = True, exclusive = True)