From b9b8145bcaa9d1025658a4e22d0d1f9b9947f8bc Mon Sep 17 00:00:00 2001 From: Jose Manuel Delicado Date: Sun, 8 May 2016 11:54:10 +0200 Subject: [PATCH] Added function com_path() to paths.py. This function is now used in libloader/com.py. Added winpaths to the easy_install example in readme.md. Updated application.py in doc folder. --- README.md | 2 +- src/libloader/com.py | 2 +- src/paths.py | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ea047603..e7aec6c5 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ setuptools installs a script, called easy_install. You can find it in the python easy_install will automatically get the additional libraries that these packages need to work properly. Run the following command to quickly install and upgrade all packages and their dependencies: -easy_install -Z --upgrade six configobj goslate markdown future suds requests oauthlib requests-oauthlib requests-toolbelt pypubsub pygeocoder arrow==0.6 python-dateutil futures markdown microsofttranslator +easy_install -Z --upgrade six configobj goslate markdown future suds requests oauthlib requests-oauthlib requests-toolbelt pypubsub pygeocoder arrow==0.6 python-dateutil futures markdown microsofttranslator winpaths #### Other dependencies diff --git a/src/libloader/com.py b/src/libloader/com.py index 29ede4c2..752b792b 100644 --- a/src/libloader/com.py +++ b/src/libloader/com.py @@ -1,7 +1,7 @@ from pywintypes import com_error import win32com import paths -win32com.__gen_path__=paths.data_path(u"com_cache") +win32com.__gen_path__=paths.com_path() import sys import os sys.path.append(os.path.join(win32com.__gen_path__, ".")) diff --git a/src/paths.py b/src/paths.py index fda43b80..84f3ef13 100644 --- a/src/paths.py +++ b/src/paths.py @@ -69,4 +69,17 @@ def locale_path(): @merge_paths def sound_path(): - return app_path(u"sounds") \ No newline at end of file + return app_path(u"sounds") + +@merge_paths +def com_path(): + global mode, directory + if mode == "portable": + if directory != None: path = os.path.join(directory, "com_cache") + elif directory == None: path = app_path(u"com_cache") + elif mode == "installed": + path = data_path(u"com_cache") + if not os.path.exists(path): + log.debug("%s path does not exist, creating..." % (path,)) + os.mkdir(path) + return path