Initial cleanup after automated refactoring.

This commit is contained in:
Bill Dengler
2017-06-17 00:58:38 +00:00
parent 9677d996d1
commit 8a05cd5600
92 changed files with 1850 additions and 2365 deletions

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import division
from builtins import str
from past.utils import old_div
def convert_bytes(n):
@@ -27,19 +27,19 @@ def seconds_to_string(seconds, precision=0):
sec_string = sec.__format__(sec_spec)
string = ""
if day == 1:
string += _(u"%d day, ") % day
string += _("%d day, ") % day
elif day >= 2:
string += _(u"%d days, ") % day
string += _("%d days, ") % day
if (hour == 1):
string += _(u"%d hour, ") % hour
string += _("%d hour, ") % hour
elif (hour >= 2):
string += _("%d hours, ") % hour
if (min == 1):
string += _(u"%d minute, ") % min
string += _("%d minute, ") % min
elif (min >= 2):
string += _(u"%d minutes, ") % min
string += _("%d minutes, ") % min
if sec >= 0 and sec <= 2:
string += _(u"%s second") % sec_string
string += _("%s second") % sec_string
else:
string += _(u"%s seconds") % sec_string
string += _("%s seconds") % sec_string
return string

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from builtins import str
from past.utils import old_div
import wx
@@ -10,7 +10,7 @@ from . import utils
progress_dialog = None
def available_update_dialog(version, description, date):
dialog = wx.MessageDialog(None, _(u"There's a new %s version available, released on %s. Would you like to download it now?\n\n %s version: %s\n\nChanges:\n%s") % (application.name, date, application.name, version, description), _(u"New version for %s") % application.name, style=wx.YES|wx.NO|wx.ICON_WARNING)
dialog = wx.MessageDialog(None, _("There's a new %s version available, released on %s. Would you like to download it now?\n\n %s version: %s\n\nChanges:\n%s") % (application.name, date, application.name, version, description), _("New version for %s") % application.name, style=wx.YES|wx.NO|wx.ICON_WARNING)
if dialog.ShowModal() == wx.ID_YES:
return True
else:
@@ -18,7 +18,7 @@ def available_update_dialog(version, description, date):
def create_progress_dialog():
return wx.ProgressDialog(_(u"Download in Progress"), _(u"Downloading the new version..."), parent=None, maximum=100)
return wx.ProgressDialog(_("Download in Progress"), _("Downloading the new version..."), parent=None, maximum=100)
def progress_callback(total_downloaded, total_size):
global progress_dialog
@@ -28,7 +28,7 @@ def progress_callback(total_downloaded, total_size):
if total_downloaded == total_size:
progress_dialog.Destroy()
else:
progress_dialog.Update(old_div((total_downloaded*100),total_size), _(u"Updating... %s of %s") % (str(utils.convert_bytes(total_downloaded)), str(utils.convert_bytes(total_size))))
progress_dialog.Update(old_div((total_downloaded*100),total_size), _("Updating... %s of %s") % (str(utils.convert_bytes(total_downloaded)), str(utils.convert_bytes(total_size))))
def update_finished():
ms = wx.MessageDialog(None, _(u"The update has been downloaded and installed successfully. Press OK to continue."), _(u"Done!")).ShowModal()
ms = wx.MessageDialog(None, _("The update has been downloaded and installed successfully. Press OK to continue."), _("Done!")).ShowModal()