Beispiel #1
0
    def __init__(self, channel, **kwargs):
        self.channel = channel
        self.signal = self.channel.signal
        self.problem_dir = self.channel.path

        def dummy(sender, event, exception):
            self.handle(sender, event, exception)

        dispatcher.connect(dummy, signal=self.signal, sender=dispatcher.Any, weak=False)
        mmp.create_dir(self.problem_dir)
        self.logger.info("Initialized problem file handler. Problem dir: '%s'" % self.problem_dir)
Beispiel #2
0
 def change_storage_root(self, store):
     """
     hooks up all the directories for you. Problem, recorded, imported,
     organize.
     """
     store_paths = mmp.expand_storage(store)
     self.set_problem_files_path(store_paths['problem_files'])
     self.set_imported_path(store_paths['imported'])
     self.set_recorded_path(store_paths['recorded'])
     self.set_organize_path(store_paths['organize'])
     mmp.create_dir(store)
     for p in store_paths.values():
         mmp.create_dir(p)
Beispiel #3
0
    def change_storage_root(self, store):
        """ hooks up all the directories for you. Problem, recorded,
        imported, organize. """
        store_paths = mmp.expand_storage(store)
        # First attempt to make sure that all paths exist before adding any
        # watches
        for path_type, path in store_paths.iteritems():
            try: mmp.create_dir(path)
            except mmp.FailedToCreateDir as e: self.unexpected_exception(e)

        os.chmod(store_paths['organize'], 0775) 

        self.set_problem_files_path(store_paths['problem_files'])
        self.set_imported_path(store_paths['imported'])
        self.set_recorded_path(store_paths['recorded'])
        self.set_organize_path(store_paths['organize'])
Beispiel #4
0
    def change_storage_root(self, store):
        """ hooks up all the directories for you. Problem, recorded,
        imported, organize. """
        store_paths = mmp.expand_storage(store)
        # First attempt to make sure that all paths exist before adding any
        # watches
        for path_type, path in store_paths.iteritems():
            try: mmp.create_dir(path)
            except mmp.FailedToCreateDir as e: self.unexpected_exception(e)

        os.chmod(store_paths['organize'], 0775) 

        self.set_problem_files_path(store_paths['problem_files'])
        self.set_imported_path(store_paths['imported'])
        self.set_recorded_path(store_paths['recorded'])
        self.set_organize_path(store_paths['organize'])
Beispiel #5
0
    def __init__(self, channel, **kwargs):
        self.channel = channel
        self.signal = getsig(self.channel.signal)
        self.problem_dir = self.channel.path

        def dummy(sender, event, exception):
            self.handle(sender, event, exception)

        dispatcher.connect(dummy,
                           signal=self.signal,
                           sender=dispatcher.Any,
                           weak=False)
        mmp.create_dir(self.problem_dir)
        self.logger.info(
            "Initialized problem file handler. Problem dir: '%s'" %
            self.problem_dir)