def __init__(self): self.create_time_stamp = None self.links_today = None self.links_this_week = None self.links_this_month = None self.links_this_year = None self.links_all = None self.redirect_today = None self.redirect_this_week = None self.redirect_this_month = None self.redirect_this_year = None self.redirect_per_week = None self.redirect_all = None self.date_of_first_redirect = None self.date_of_first_link = None self._db = YuDatabase() self._update()
def __init__(self, shorthash): self._db = YuDatabase() if shorthash is not None and self._db is not None: link_details = self._db.get_link_details(shorthash) if link_details: if link_details[5]: self.creation_time = '%s (UTC)' % (link_details[5]) else: self.creation_time = 'Unknown' self.link_address = link_details[3] self.first_redirect = self._db.get_date_of_first_entry( 'hashredirect', shorthash)[0] self.last_redirect = self._db.get_date_of_last_entry( 'hashredirect', shorthash)[0] self.number_of_redirects = self._db.get_statistics_for_hash( shorthash) return self.link_address = None self.creation_time = None self.first_redirect = None self.last_redirect = None self.number_of_redirects = None
def __init__(self, request, client_address, server): self._db = YuDatabase() self._logger = get_logger() self._header_only = False BaseHTTPRequestHandler.__init__(self, request, client_address, server)