X-Git-Url: http://git.onelab.eu/?p=plcapi.git;a=blobdiff_plain;f=PLC%2FMethods%2F__init__.py;h=9b6645bf5e23939d52d24582d9f42b416ec5d539;hp=000edba8aa9fb6ff8737e0d63db4004d8c913b5a;hb=24f0a4528061afbca3299e92005bb19e631b323a;hpb=be1560a0ece794e0f047e6e3c18d4b78ec746b15 diff --git a/PLC/Methods/__init__.py b/PLC/Methods/__init__.py index 000edba..9b6645b 100644 --- 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 -# like `make sync` we can easily end up with more files that needed +# like `make sync` we can easily end up with more files than needed # which breaks in production contents = [ @@ -18,8 +18,9 @@ contents = [ ] for dir, pattern in contents: - prefix = len(dir) + 1 - matches = glob.glob("{}/{}".format(dir, pattern)) + matches = glob.glob("{}/{}/{}".format(toppath, dir, pattern)) + # count 2 slashes + prefix = len(toppath) + 1 + len(dir) + 1 for match in matches: filename = match[prefix:][:-3] python_name = filename if dir == '.' \