Adapted some files to changes present in renderers

This commit is contained in:
Manuel Cortez 2018-12-06 17:34:48 -06:00
parent d0de4ac677
commit 4a83edf3bc
4 changed files with 6 additions and 9 deletions

View File

@ -2,7 +2,6 @@
import time import time
import os import os
import wx import wx
import utils
import widgetUtils import widgetUtils
import messages import messages
import buffers import buffers
@ -19,7 +18,7 @@ from pubsub import pub
from mysc.repeating_timer import RepeatingTimer from mysc.repeating_timer import RepeatingTimer
from mysc.thread_utils import call_threaded from mysc.thread_utils import call_threaded
from mysc import localization from mysc import localization
from sessionmanager import session from sessionmanager import session, utils
from wxUI import (mainWindow, commonMessages) from wxUI import (mainWindow, commonMessages)
from wxUI.dialogs import search as searchDialogs from wxUI.dialogs import search as searchDialogs
from wxUI.dialogs import timeline, creation from wxUI.dialogs import timeline, creation

View File

@ -11,7 +11,6 @@ import widgetUtils
import output import output
import wx import wx
import webbrowser import webbrowser
import utils
import logging import logging
from sessionmanager import session # We'll use some functions from there from sessionmanager import session # We'll use some functions from there
from sessionmanager import utils from sessionmanager import utils
@ -20,7 +19,6 @@ from wxUI.dialogs import postDialogs, urlList, profiles
from extra import SpellChecker, translator from extra import SpellChecker, translator
from mysc.thread_utils import call_threaded from mysc.thread_utils import call_threaded
from wxUI import menus from wxUI import menus
from utils import add_attachment
log = logging.getLogger("controller.post") log = logging.getLogger("controller.post")
@ -134,7 +132,7 @@ class postController(object):
if i["type"] == "photo": if i["type"] == "photo":
if self.load_images == False: self.load_images = True if self.load_images == False: self.load_images = True
self.images.append(i) self.images.append(i)
attachments.append(add_attachment(i)) attachments.append(extract_attachment(i))
self.attachments.append(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 # 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. # 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: for i in urls:
links.append({"link": {"title": _(U"Untitled link"), "url": i}, "type": "link"}) links.append({"link": {"title": _(U"Untitled link"), "url": i}, "type": "link"})
for i in links: for i in links:
attachments.append(add_attachment(i)) attachments.append(extract_attachment(i))
self.attachments.append(i) self.attachments.append(i)
if len(self.attachments) > 0: if len(self.attachments) > 0:
self.dialog.attachments.list.Enable(True) self.dialog.attachments.list.Enable(True)

View File

@ -9,8 +9,8 @@ import languageHandler
import widgetUtils import widgetUtils
import output import output
import wx import wx
import utils
from wxUI.dialogs import urlList, profiles from wxUI.dialogs import urlList, profiles
from sessionmanager import utils
log = logging.getLogger("controller.profiles") log = logging.getLogger("controller.profiles")

View File

@ -4,7 +4,7 @@ import os
import requests import requests
import re import re
import logging import logging
from sessionmanager import session from sessionmanager import renderers
log = logging.getLogger("utils") log = logging.getLogger("utils")
url_re = re.compile("(?:\w+://|www\.)[^ ,.?!#%=+][^ ]*") url_re = re.compile("(?:\w+://|www\.)[^ ,.?!#%=+][^ ]*")
bad_chars = '\'\\.,[](){}:;"' bad_chars = '\'\\.,[](){}:;"'
@ -76,7 +76,7 @@ def add_attachment(attachment):
msg = u"{0}".format(attachment["video"]["title"],) msg = u"{0}".format(attachment["video"]["title"],)
tpe = _(u"Video") tpe = _(u"Video")
elif attachment["type"] == "audio": 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") tpe = _(u"Audio")
elif attachment["type"] == "doc": elif attachment["type"] == "doc":
if attachment["doc"].has_key("preview") and attachment["doc"]["preview"].has_key("audio_msg"): if attachment["doc"].has_key("preview") and attachment["doc"]["preview"].has_key("audio_msg"):