Beispiel #1
0
 def cb():
     try:
         callback(requests)
     except Exception as e:
         pyfalog.critical("Execution of callback from getPrices failed.")
         pyfalog.critical(e)
     db.commit()
Beispiel #2
0
        def cb():
            try:
                callback(requests)
            except Exception as e:
                pyfalog.critical("Callback failed.")
                pyfalog.critical(e)

            db.commit()
Beispiel #3
0
        def cb():
            try:
                callback(requests)
            except Exception as e:
                pyfalog.critical("Callback failed.")
                pyfalog.critical(e)

            db.commit()
Beispiel #4
0
        def cb():
            try:
                callback(requests)
            except Exception as e:
                pyfalog.critical("Execution of callback from getPrices failed.")
                pyfalog.critical(e)

            db.commit()
Beispiel #5
0
 def cb():
     try:
         callback(requests)
     except (KeyboardInterrupt, SystemExit):
         raise
     except Exception as e:
         pyfalog.critical("Execution of callback from getPrices failed.")
         pyfalog.critical(e)
     db.commit()
Beispiel #6
0
    def importPatterns(self, text):
        lookup = {}
        current = self.getTargetResistsList()
        for pattern in current:
            lookup[pattern.name] = pattern

        imports, num = es_TargetResists.importPatterns(text)
        for pattern in imports:
            if pattern.name in lookup:
                match = lookup[pattern.name]
                match.__dict__.update(pattern.__dict__)
            else:
                db.save(pattern)
        db.commit()

        lenImports = len(imports)
        if lenImports == 0:
            raise ImportError("No patterns found for import")
        if lenImports != num:
            raise ImportError("%d patterns imported from clipboard; %d had errors" % (num, num - lenImports))
Beispiel #7
0
    def importPatterns(self, text):
        lookup = {}
        current = self.getTargetResistsList()
        for pattern in current:
            lookup[pattern.name] = pattern

        imports, num = es_TargetResists.importPatterns(text)
        for pattern in imports:
            if pattern.name in lookup:
                match = lookup[pattern.name]
                match.__dict__.update(pattern.__dict__)
            else:
                db.save(pattern)
        db.commit()

        lenImports = len(imports)
        if lenImports == 0:
            raise ImportError("No patterns found for import")
        if lenImports != num:
            raise ImportError(
                "%d patterns imported from clipboard; %d had errors" %
                (num, num - lenImports))