593 Private method to start the timer to recalculate the frequencies. |
593 Private method to start the timer to recalculate the frequencies. |
594 """ |
594 """ |
595 tomorrow = QDateTime(QDate.currentDate().addDays(1), QTime(3, 0)) |
595 tomorrow = QDateTime(QDate.currentDate().addDays(1), QTime(3, 0)) |
596 self.__frequencyTimer.start( |
596 self.__frequencyTimer.start( |
597 QDateTime.currentDateTime().secsTo(tomorrow) * 1000) |
597 QDateTime.currentDateTime().secsTo(tomorrow) * 1000) |
|
598 |
|
599 def siteVisitsCount(self, scheme, host): |
|
600 """ |
|
601 Public method to get the visit count for a web site using the given |
|
602 scheme. |
|
603 |
|
604 @param scheme scheme to look for |
|
605 @type str |
|
606 @param host host to look for |
|
607 @type str |
|
608 @return number of visits to this site |
|
609 @rtype int |
|
610 """ |
|
611 count = 0 |
|
612 url = "{0}://{1}".format(scheme.lower(), host.lower()) |
|
613 |
|
614 seenUrls = [] |
|
615 |
|
616 for index in range(len(self.__history)): |
|
617 historyUrl = self.__history[index].url |
|
618 if historyUrl.startswith(url) and historyUrl not in seenUrls: |
|
619 count += self.__history[index].visitCount |
|
620 seenUrls.append(historyUrl) |
|
621 |
|
622 return count |