summaryrefslogtreecommitdiffstats
path: root/pyload/__init__.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-10 17:01:05 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-10 17:01:05 +0200
commit8606b72470e0e506d9da26f190a2880d47d289a4 (patch)
tree6225bba54bafb655ca969a1287673807c7c2d131 /pyload/__init__.py
parentMerge branch 'stable' into 0.4.10 (diff)
downloadpyload-8606b72470e0e506d9da26f190a2880d47d289a4.tar.xz
Improve and fix file structure a bit
Diffstat (limited to 'pyload/__init__.py')
-rw-r--r--pyload/__init__.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/pyload/__init__.py b/pyload/__init__.py
index 7f5ac0667..32235c68f 100644
--- a/pyload/__init__.py
+++ b/pyload/__init__.py
@@ -2,16 +2,6 @@
from __future__ import with_statement
-import __builtin__
-
-import os
-import platform
-import sys
-
-from codecs import getwriter
-
-from pyload.utils import get_console_encoding
-
__all__ = ["__status_code__", "__status__", "__version_info__", "__version__", "__author_name__", "__author_mail__", "__license__"]
@@ -45,6 +35,9 @@ __authors__ = [("Marius" , "mkaay@mkaay.de" ),
################################# InitHomeDir #################################
+import __builtin__
+import os
+
__builtin__.owd = os.path.abspath("") #: original working directory
__builtin__.homedir = os.path.expanduser("~")
__builtin__.rootdir = os.path.abspath(os.path.join(__file__, ".."))
@@ -52,14 +45,19 @@ __builtin__.configdir = ""
__builtin__.pypath = os.path.abspath(os.path.join(rootdir, ".."))
-if "64" in platform.machine():
- sys.path.append(os.path.join(pypath, "lib64"))
+import sys
+
sys.path.append(os.path.join(pypath, "lib", "Python", "Lib"))
sys.path.append(os.path.join(pypath, "lib"))
+from codecs import getwriter
+
+from pyload.utils import get_console_encoding
+
sys.stdout = getwriter(get_console_encoding(sys.stdout.encoding))(sys.stdout, errors="replace")
+
if homedir == "~" and os.name == "nt":
import ctypes
@@ -78,6 +76,7 @@ if homedir == "~" and os.name == "nt":
__builtin__.homedir = path_buf.value
+
try:
p = os.path.join(rootdir, "config", "configdir")
@@ -90,6 +89,7 @@ except IOError:
else:
configdir = os.path.join(homedir, "pyload")
+
try:
if not os.path.exists(configdir):
os.makedirs(configdir, 0700)