Upgrade to Python 3

This commit is contained in:
Nemo 2017-12-24 16:43:07 +05:30
parent 297ef91497
commit 678b0090c4
5 changed files with 13 additions and 13 deletions

View File

@ -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:

View File

@ -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 {}

View File

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

View File

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

View File

@ -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