Ejemplo n.º 1
0
    def read(self):
        if not os.path.exists("bin/config.conf"):
            log.warning("Configuration file missing")
            from cron import FileManager

            FileManager()

        with closing(open("bin/config.conf", "rb")) as fl:
            self.data = Pickle.load(fl)
            return self.data
Ejemplo n.º 2
0
 def _catchFailure(self, failure):
     if not failure:
         return
     log.warning(failure.getErrorMessage)
     print failure.getErrorMessage()
Ejemplo n.º 3
0
 def get_database(self):
     try:
         return self.data["connection"]["database"]
     except KeyError:
         log.warning("Database name missing")
         return "bima"
Ejemplo n.º 4
0
 def get_dialect(self):
     try:
         return self.data["connection"]["dialect"]
     except KeyError:
         log.warning("Database dialect missing")
         return "mysql"
Ejemplo n.º 5
0
 def get_user(self):
     try:
         return self.get_security_details()["user"]
     except KeyError:
         log.warning("Configuration file missing database user name")
         return "server2"
Ejemplo n.º 6
0
 def get_password(self):
     try:
         return self.get_security_details()["password"]
     except KeyError:
         log.warning("Configuration file missing database password")
         return self.create_signature("secrete_key")