Upgrade to Python 3

pull/30/head
Nemo 5 years ago
parent 297ef91497
commit 678b0090c4
  1. 16
      hackertray/__init__.py
  2. 2
      hackertray/analytics.py
  3. 2
      hackertray/chrome.py
  4. 2
      hackertray/firefox.py
  5. 4
      hackertray/version.py

@ -16,20 +16,20 @@ if(os.environ.get('TRAVIS')!='true'):
try:
import appindicator
except ImportError:
import appindicator_replacement as appindicator
from . import appindicator_replacement as appindicator
from appindicator_replacement import get_icon_filename
from .appindicator_replacement import get_icon_filename
import json
import argparse
from os.path import expanduser
import signal
from hackernews import HackerNews
from chrome import Chrome
from firefox import Firefox
from version import Version
from analytics import Analytics
from .hackernews import HackerNews
from .chrome import Chrome
from .firefox import Firefox
from .version import Version
from .analytics import Analytics
class HackerNewsApp:
HN_URL_PREFIX = "https://news.ycombinator.com/item?id="
@ -211,7 +211,7 @@ class HackerNewsApp:
self.addItem(item)
# Catch network errors
except requests.exceptions.RequestException as e:
print "[+] There was an error in fetching news items"
print("[+] There was an error in fetching news items")
finally:
# Call every 10 minutes
if not no_timer:

@ -8,7 +8,7 @@ class Analytics:
self.dnt = dnt
self.tracker = Mixpanel(token)
if(self.dnt == True):
print "[+] Analytics disabled"
print("[+] Analytics disabled")
# Track an event
# event - string containing the event name
# data - data related to the event, defaults to {}

@ -1,4 +1,4 @@
from __future__ import print_function
import sqlite3
import shutil
import os

@ -1,4 +1,4 @@
from __future__ import print_function
import sqlite3
import shutil
import os

@ -18,10 +18,10 @@ class Version:
current = Version.current()
try:
if pkg_resources.parse_version(latest) > pkg_resources.parse_version(current):
print "[+] New version " + latest + " is available"
print("[+] New version " + latest + " is available")
return True
else:
return False
except requests.exceptions.RequestException as e:
print "[+] There was an error in trying to fetch updates"
print("[+] There was an error in trying to fetch updates")
return False
Loading…
Cancel
Save