1.1 --- a/tools/update_storage_modules.py Thu Jan 26 19:21:02 2017 +0100
1.2 +++ b/tools/update_storage_modules.py Thu Jan 26 19:33:34 2017 +0100
1.3 @@ -22,22 +22,27 @@
1.4 from glob import glob
1.5 from os import listdir
1.6 from os.path import commonprefix, isdir, join, split, splitext
1.7 -import imiptools.stores
1.8 +import imp
1.9
1.10 reserved = ["__init__.py", "common.py", "manifest.py"]
1.11
1.12 def get_extensions(dirname):
1.13 filenames = []
1.14 - for filename in glob(join(dirname, "*.py")):
1.15 + found = glob(join(dirname, "*.py"))
1.16 + found.sort()
1.17 +
1.18 + for filename in found:
1.19 leafname = split(filename)[-1]
1.20 if leafname not in reserved:
1.21 filenames.append(filename)
1.22 +
1.23 return filenames
1.24
1.25 # The main program generating a new version of the manifest module.
1.26
1.27 if __name__ == "__main__":
1.28 - dirname = join(split(imiptools.stores.__file__)[0], "")
1.29 + _f, dirname, _d = imp.find_module("imiptools/stores")
1.30 + dirname = join(dirname, "")
1.31 manifest = join(dirname, "manifest.py")
1.32
1.33 # Get all Python files in the stores directory, filtering out the
1.34 @@ -47,7 +52,10 @@
1.35
1.36 # Get all extensions from directories in the stores directory.
1.37
1.38 - for filename in listdir(dirname):
1.39 + found = listdir(dirname)
1.40 + found.sort()
1.41 +
1.42 + for filename in found:
1.43 filename = join(dirname, filename)
1.44 if isdir(filename):
1.45 filenames += get_extensions(filename)