INNER CODE UNIT · Python
__init__
opentimestamps/opentimestamps-server · otsserver/backup.py:231
def __init__(self, db, calendar_url, base_path, btc_net):
self.db = db
self.calendar_url = calendar_url
calendar_url_parsed = urlparse(calendar_url)
self.up_to_path = os.path.join(base_path, calendar_url_parsed.netloc)
self.btc_net = btc_net
super().__init__(target=self.loop)
def loop(self):
logging.info("Starting loop for %s" % self.calendar_url)
try:
logging.debug("Opening %s" % self.up_to_path)
with open(self.up_to_path, 'r') as up_to_fd:
last_known = int(up_to_fd.read().strip())
except FileNotFoundError as exp:
last_known = -1