From 73d96dce951aa2cd49c948e526ae552a05df345d Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 22 Sep 2019 01:08:39 +0200 Subject: fix patchdir The designated patchdir of an Allocator class is located at src/allocators/ --- src/allocator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/allocator.py b/src/allocator.py index 9473f84..23b5147 100644 --- a/src/allocator.py +++ b/src/allocator.py @@ -56,10 +56,11 @@ class Allocator: "build_cmds"] def __init__(self, name, **kwargs): + self.class_file = inspect.getfile(self.__class__) self.name = name self.srcdir = os.path.join(SRCDIR, self.name) self.dir = os.path.join(BUILDDIR, self.name) - self.patchdir = os.path.join(src.globalvars.allocsrcdir, self.name) + self.patchdir = os.path.join(os.path.splitext(self.class_file)[0]) # Update attributes self.__dict__.update((k, v) for k, v in kwargs.items() if k in self.allowed_attributes) @@ -117,7 +118,7 @@ class Allocator: with open(buildtimestamp_path, "r") as buildtimestamp_file: timestamp = datetime.fromtimestamp(float(buildtimestamp_file.read())) - modtime = os.stat(inspect.getfile(self.__class__)).st_mtime + modtime = os.stat(self.class_file).st_mtime modtime = datetime.fromtimestamp(modtime) build_needed = timestamp < modtime -- cgit v1.2.3