1.1 --- a/tools/update_scheduling_modules.py Thu Jan 26 19:21:02 2017 +0100
1.2 +++ b/tools/update_scheduling_modules.py Thu Jan 26 19:33:34 2017 +0100
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Update the scheduling modules import manifest.
1.6
1.7 -Copyright (C) 2016 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -21,20 +21,24 @@
1.13
1.14 from glob import glob
1.15 from os.path import join, split, splitext
1.16 -import imiptools.handlers
1.17 +import imp
1.18
1.19 reserved = ["__init__.py", "common.py", "manifest.py"]
1.20
1.21 # The main program generating a new version of the manifest module.
1.22
1.23 if __name__ == "__main__":
1.24 - dirname = join(split(imiptools.handlers.__file__)[0], "scheduling")
1.25 + _f, dirname, _d = imp.find_module("imiptools/handlers")
1.26 + dirname = join(dirname, "scheduling")
1.27
1.28 # Get all Python files in the scheduling directory, filtering out the
1.29 # reserved files that do not provide scheduling functions.
1.30
1.31 filenames = []
1.32 - for filename in glob(join(dirname, "*.py")):
1.33 + found = glob(join(dirname, "*.py"))
1.34 + found.sort()
1.35 +
1.36 + for filename in found:
1.37 filename = split(filename)[-1]
1.38 if filename not in reserved:
1.39 filenames.append(filename)