def set_config(): try: file = sys.argv[1] except IndexError: file = "config/config.yml" logging.info("using file: %s", file) CONFIG.init(cfile=file) logging.info("config successfully loaded: %s", CONFIG.config)
def setUp(self): self.conf_file = "config/config.test.yml.tmp" self.db_file = 'test_sent_to_cal.db' self.t_client = Trello_Client(self.db_file) copyfile("config/config.test.yml", self.conf_file) CONFIG.init(self.conf_file)
def init(self, config_file=None): if config_file is not None: logging.info("Initialising config %s from Calendar_Client.", config_file) CONFIG.init(cfile=config_file) url = CONFIG.get_cal_url() logging.info("connecting to %s", url) try: client = caldav.DAVClient(url) except KeyError: CONFIG.request_calendar() client = caldav.DAVClient(CONFIG.get_cal_url()) principal = client.principal() calendars = principal.calendars() if calendars: self.calendar = calendars[0]
def setUp(self): self.conf_file = "config/config.test.yml.tmp" copyfile("config/config.test.yml", self.conf_file) CONFIG.init(cfile=self.conf_file)