diff --git a/src/controller/mainController.py b/src/controller/mainController.py index cf68966..df4f580 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -2,7 +2,6 @@ import time import os import wx -import utils import widgetUtils import messages import buffers @@ -19,7 +18,7 @@ from pubsub import pub from mysc.repeating_timer import RepeatingTimer from mysc.thread_utils import call_threaded from mysc import localization -from sessionmanager import session +from sessionmanager import session, utils from wxUI import (mainWindow, commonMessages) from wxUI.dialogs import search as searchDialogs from wxUI.dialogs import timeline, creation diff --git a/src/controller/posts.py b/src/controller/posts.py index f4f01d1..6549bcc 100644 --- a/src/controller/posts.py +++ b/src/controller/posts.py @@ -11,7 +11,6 @@ import widgetUtils import output import wx import webbrowser -import utils import logging from sessionmanager import session # We'll use some functions from there from sessionmanager import utils @@ -20,7 +19,6 @@ from wxUI.dialogs import postDialogs, urlList, profiles from extra import SpellChecker, translator from mysc.thread_utils import call_threaded from wxUI import menus -from utils import add_attachment log = logging.getLogger("controller.post") @@ -134,7 +132,7 @@ class postController(object): if i["type"] == "photo": if self.load_images == False: self.load_images = True self.images.append(i) - attachments.append(add_attachment(i)) + attachments.append(extract_attachment(i)) self.attachments.append(i) # Links in text are not treated like normal attachments, so we'll have to catch and add those to the list without title # We can't get a title because title is provided by the VK API and it will not work for links as simple text. @@ -144,7 +142,7 @@ class postController(object): for i in urls: links.append({"link": {"title": _(U"Untitled link"), "url": i}, "type": "link"}) for i in links: - attachments.append(add_attachment(i)) + attachments.append(extract_attachment(i)) self.attachments.append(i) if len(self.attachments) > 0: self.dialog.attachments.list.Enable(True) diff --git a/src/controller/profiles.py b/src/controller/profiles.py index 3a7d274..cb346dc 100644 --- a/src/controller/profiles.py +++ b/src/controller/profiles.py @@ -9,8 +9,8 @@ import languageHandler import widgetUtils import output import wx -import utils from wxUI.dialogs import urlList, profiles +from sessionmanager import utils log = logging.getLogger("controller.profiles") diff --git a/src/sessionmanager/utils.py b/src/sessionmanager/utils.py index 2de0b4e..1942d3e 100644 --- a/src/sessionmanager/utils.py +++ b/src/sessionmanager/utils.py @@ -4,7 +4,7 @@ import os import requests import re import logging -from sessionmanager import session +from sessionmanager import renderers log = logging.getLogger("utils") url_re = re.compile("(?:\w+://|www\.)[^ ,.?!#%=+][^ ]*") bad_chars = '\'\\.,[](){}:;"' @@ -76,7 +76,7 @@ def add_attachment(attachment): msg = u"{0}".format(attachment["video"]["title"],) tpe = _(u"Video") elif attachment["type"] == "audio": - msg = u"{0}".format(" ".join(session.compose_audio(attachment["audio"]))) + msg = u"{0}".format(" ".join(session.render_audio(attachment["audio"]))) tpe = _(u"Audio") elif attachment["type"] == "doc": if attachment["doc"].has_key("preview") and attachment["doc"]["preview"].has_key("audio_msg"):