[Buildbot-devel] Factories and filters

Stephen Thorne stephen.thorne at gmail.com
Tue Jul 19 23:10:52 UTC 2005

On 20/07/05, Dobes Vandermeer <dobesv at gmail.com> wrote:
> I'm not sure whether this will still be relevant with the new
> sceduler, but I'm having an annoying problem with the filtering of the
> build.
> Currently I'm subclassing Build and overriding isFileImportant().
> Unfortunately, this means that each time I reload the master config,
> it thinks that all the factories have changed.
> This happens because the build class is being defined in master.cfg,
> so each time master.cfg is re-loaded, the class is re-defined and is
> no longer equal to the old class.
> If I move the build class into another module, then changes to my
> filters won't be noticed when I reload the config.
> Has anyone found a solution to this conundrum?

in your new module where you define the class you're using, define:

def getModifiedTime():
  import mymodule
  t = os.stat(mymodule.__file__)[stat.ST_MTIME]

class MyClass:
   mtime = getModifiedTime()

then in master.cfg
import mymodule
if mymodule.getModifiedTime() > mymodule.MyClass.mtime:

And that should do it.
(untested code, YMMV, no warrenty of any kind except)
Stephen Thorne
Development Engineer

More information about the devel mailing list