Initial Python 3 compatible code

This commit is contained in:
2019-06-06 11:52:23 -05:00
parent d441536f01
commit ef689d04fc
146 changed files with 589 additions and 246 deletions

View File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
import glob
import os.path
import platform

View File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
from logging import getLogger
logger = getLogger('update')

View File

@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import application
from . import update
import platform

View File

@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from builtins import str
def convert_bytes(n):
K, M, G, T, P = 1 << 10, 1 << 20, 1 << 30, 1 << 40, 1 << 50
if n >= P:

View File

@@ -1,5 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from builtins import str
from past.utils import old_div
import wx
import application
from . import utils
@@ -25,7 +29,7 @@ def progress_callback(total_downloaded, total_size):
if total_downloaded == total_size:
progress_dialog.Destroy()
else:
progress_dialog.Update((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), _(u"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()