mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-07-17 21:56:07 -04:00
Changed codebase's syntax before attempt the python3 migration later. #273
This commit is contained in:
@@ -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
|
||||
|
@@ -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,)
|
@@ -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):
|
||||
|
@@ -1 +1,2 @@
|
||||
from soundsTutorial import soundsTutorial
|
||||
from __future__ import absolute_import
|
||||
from .soundsTutorial import soundsTutorial
|
||||
|
@@ -1,15 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import
|
||||
import platform
|
||||
import widgetUtils
|
||||
import os
|
||||
import paths
|
||||
import logging
|
||||
log = logging.getLogger("extra.SoundsTutorial.soundsTutorial")
|
||||
import soundsTutorial_constants
|
||||
from . import soundsTutorial_constants
|
||||
if platform.system() == "Windows":
|
||||
import wx_ui as UI
|
||||
from . import wx_ui as UI
|
||||
elif platform.system() == "Linux":
|
||||
import gtk_ui as UI
|
||||
from . import gtk_ui as UI
|
||||
|
||||
class soundsTutorial(object):
|
||||
def __init__(self, sessionObject):
|
||||
|
@@ -1,5 +1,7 @@
|
||||
#-*- coding: utf-8 -*-
|
||||
import reverse_sort
|
||||
from __future__ import absolute_import
|
||||
#-*- coding: utf-8 -*-
|
||||
from . import reverse_sort
|
||||
import application
|
||||
actions = reverse_sort.reverse_sort([ ("audio", _(u"Audio tweet.")),
|
||||
("create_timeline", _(u"User timeline buffer created.")),
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import spellchecker
|
||||
from __future__ import absolute_import
|
||||
from . import spellchecker
|
||||
import platform
|
||||
if platform.system() == "Windows":
|
||||
from wx_ui import *
|
||||
from .wx_ui import *
|
@@ -1,14 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import
|
||||
import os
|
||||
import logging
|
||||
import wx_ui
|
||||
from . import wx_ui
|
||||
import widgetUtils
|
||||
import output
|
||||
import config
|
||||
import languageHandler
|
||||
import enchant
|
||||
import paths
|
||||
import twitterFilter
|
||||
from . import twitterFilter
|
||||
from enchant.checker import SpellChecker
|
||||
from enchant.errors import DictNotFoundError
|
||||
from enchant import tokenize
|
||||
@@ -52,7 +53,7 @@ class spellChecker(object):
|
||||
|
||||
def check(self):
|
||||
try:
|
||||
self.checker.next()
|
||||
next(self.checker)
|
||||
textToSay = _(u"Misspelled word: %s") % (self.checker.word,)
|
||||
context = u"... %s %s %s" % (self.checker.leading_context(10), self.checker.word, self.checker.trailing_context(10))
|
||||
self.dialog.set_title(textToSay)
|
||||
|
@@ -1,2 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import completion, settings
|
||||
from __future__ import absolute_import
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import completion, settings
|
@@ -1,7 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import
|
||||
import output
|
||||
import storage
|
||||
import wx_menu
|
||||
from . import storage
|
||||
from . import wx_menu
|
||||
|
||||
class autocompletionUsers(object):
|
||||
def __init__(self, window, session_id):
|
||||
|
@@ -1,7 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import storage
|
||||
from __future__ import absolute_import
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import storage
|
||||
import widgetUtils
|
||||
import wx_manage
|
||||
from . import wx_manage
|
||||
from wxUI import commonMessageDialogs
|
||||
|
||||
class autocompletionManage(object):
|
||||
|
@@ -1,8 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import storage
|
||||
from __future__ import absolute_import
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import storage
|
||||
import widgetUtils
|
||||
import wx_settings
|
||||
import manage
|
||||
from . import wx_settings
|
||||
from . import manage
|
||||
import output
|
||||
from mysc.thread_utils import call_threaded
|
||||
|
||||
|
@@ -1,2 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import OCRSpace
|
||||
from __future__ import absolute_import
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import OCRSpace
|
@@ -1,6 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import translator
|
||||
from __future__ import absolute_import
|
||||
from . import translator
|
||||
import platform
|
||||
if platform.system() == "Windows":
|
||||
import wx_ui as gui
|
||||
from . import wx_ui as gui
|
||||
|
@@ -16,7 +16,26 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
############################################################
|
||||
import translator
|
||||
from __future__ import absolute_import
|
||||
# -*- coding: utf-8 -*-
|
||||
############################################################
|
||||
# Copyright (c) 2013, 2014 Manuel Eduardo Cortéz Vallejo <manuel@manuelcortez.net>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
############################################################
|
||||
from . import translator
|
||||
import wx
|
||||
from wxUI.dialogs import baseDialog
|
||||
|
||||
|
Reference in New Issue
Block a user