[Python-modules-commits] [gamera] 08/12: fix-paths
Daniel Stender
stender at moszumanska.debian.org
Sun Jul 16 07:24:13 UTC 2017
This is an automated email from the git hooks/post-receive script.
stender pushed a commit to branch patch-queue/debian/master
in repository gamera.
commit ea7c4234020f0ab4798d8e4bec4289e555b1c0b1
Author: Jakub Wilk <jwilk at debian.org>
Date: Sat Oct 17 18:54:39 2015 +0200
fix-paths
make plugin/toolkit/test paths compatible with python-support. Fix
documentation generator to look for test files in the build directory.
Forwarded: not-needed
Gbp-Pq: Name 0008-fix-paths.patch
---
doc/gendoc.py | 6 ++++++
gamera/paths.py | 12 +++++-------
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/doc/gendoc.py b/doc/gendoc.py
index e7887d6..76257e1 100755
--- a/doc/gendoc.py
+++ b/doc/gendoc.py
@@ -2,6 +2,12 @@
from gamera import core, gendoc
+import sys
+import os
+import gamera.paths
+
+gamera.paths.test = os.path.join(os.path.dirname(__file__), '..', 'gamera', 'test')
+
if __name__ == "__main__":
core.init_gamera()
gendoc.gendoc(classes=[
diff --git a/gamera/paths.py b/gamera/paths.py
index 7386a83..824cae4 100644
--- a/gamera/paths.py
+++ b/gamera/paths.py
@@ -22,11 +22,7 @@
from __future__ import generators
import os, sys, dircache, glob, imp # Python standard library
-if 1:
- def dummy():
- pass
-
-lib = os.path.dirname(os.path.realpath(dummy.func_code.co_filename))
+lib = os.path.dirname(__file__)
lib_gui = os.path.realpath(os.path.join(lib, "gui"))
# Figure out if we are in the source directory or installed
plugins = os.path.realpath(os.path.join(lib, "plugins"))
@@ -34,11 +30,13 @@ doc = os.path.realpath(os.path.join(lib, "doc"))
sys.path.append(plugins)
plugins_src = ""
toolkits = os.path.realpath(os.path.join(lib, "toolkits"))
-test = os.path.realpath(os.path.join(lib, "test"))
-test_results = os.path.realpath(os.path.join(lib, "test/results"))
+test = '/usr/share/gamera/test/'
+test_results = os.path.join(test, 'results')
def get_toolkit_names(dir):
toolkits = []
+ if not os.path.exists(dir):
+ return toolkits
listing = dircache.listdir(dir)
dircache.annotate(dir, listing)
for toolkit in listing:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/gamera.git
More information about the Python-modules-commits
mailing list