Changed codebase's syntax before attempt the python3 migration later. #273

This commit is contained in:
2018-11-22 13:35:19 -06:00
parent 4391e3d3de
commit 221d1d413b
53 changed files with 264 additions and 190 deletions

View File

@@ -16,10 +16,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
############################################################
from __future__ import absolute_import
import widgetUtils
import wx_ui
import wx_transfer_dialogs
import transfer
from . import wx_ui
from . import wx_transfer_dialogs
from . import transfer
import output
import tempfile
import sound

View File

@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import sys
import threading
import time
import logging
from utils import convert_bytes
from .utils import convert_bytes
from pubsub import pub
log = logging.getLogger("extra.AudioUploader.transfer")
from requests_toolbelt.multipart.encoder import MultipartEncoder, MultipartEncoderMonitor
@@ -75,9 +76,9 @@ class Upload(object):
data = self.response.json()
except:
return _("Error in file upload: {0}").format(self.data.content,)
if data.has_key("url") and data["url"] != "0":
if "url" in data and data["url"] != "0":
return data["url"]
elif data.has_key("error") and data["error"] != "0":
elif "error" in data and data["error"] != "0":
return data["error"]
else:
return _("Error in file upload: {0}").format(self.data.content,)

View File

@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import wx
from utils import *
from .utils import *
import widgetUtils
class UploadDialog(widgetUtils.BaseDialog):