git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bugfix, scanning native_methods needs to start in installed dir, not '.'
[plcapi.git]
/
PLC
/
Methods
/
__init__.py
diff --git
a/PLC/Methods/__init__.py
b/PLC/Methods/__init__.py
index
dbf9959
..
9b6645b
100644
(file)
--- a/
PLC/Methods/__init__.py
+++ b/
PLC/Methods/__init__.py
@@
-9,7
+9,7
@@
native_methods = []
toppath = os.path.dirname(__file__)
# do not blindly scan this directory, as when using devel tools
toppath = os.path.dirname(__file__)
# do not blindly scan this directory, as when using devel tools
-# like `make sync` we can easily end up with more files tha
t
needed
+# like `make sync` we can easily end up with more files tha
n
needed
# which breaks in production
contents = [
# which breaks in production
contents = [
@@
-18,9
+18,9
@@
contents = [
]
for dir, pattern in contents:
]
for dir, pattern in contents:
- prefix = len(dir) + 1
- matches = glob.glob("{}/{}".format(dir, pattern))
- pr
int(matches)
+ matches = glob.glob("{}/{}/{}".format(toppath, dir, pattern))
+ # count 2 slashes
+ pr
efix = len(toppath) + 1 + len(dir) + 1
for match in matches:
filename = match[prefix:][:-3]
python_name = filename if dir == '.' \
for match in matches:
filename = match[prefix:][:-3]
python_name = filename if dir == '.' \