Refactored attachment code so it will match to the MVP pattern

This commit is contained in:
2019-01-06 22:51:20 -06:00
parent 71ce8597e5
commit 589a7da53b
9 changed files with 257 additions and 4 deletions

View File

@@ -6,6 +6,9 @@ import logging
import webbrowser
import arrow
import wx
import presenters
import views
import interactors
import languageHandler
import widgetUtils
from . import messages
@@ -13,7 +16,6 @@ from presenters import player
import output
from . import selector
from . import posts
from . import attach
from pubsub import pub
from vk_api.exceptions import VkApiError
from vk_api import upload
@@ -840,7 +842,7 @@ class chatBuffer(baseBuffer):
return retrieved
def add_attachment(self, *args, **kwargs):
a = attach.attach(self.session, True)
a = presenters.attachPresenter(session=self.session, view=views.attachDialog(voice_messages=True), interactor=interactors.attachInteractor())
if len(a.attachments) != 0:
self.attachments_to_be_sent = a.attachments

View File

@@ -2,9 +2,11 @@
from __future__ import unicode_literals
import time
import widgetUtils
import presenters
import views
import interactors
import output
from pubsub import pub
from . import attach
from wxUI.dialogs import message, selector
from extra import SpellChecker, translator
from logging import getLogger
@@ -71,7 +73,7 @@ class post(object):
checker.clean()
def show_attach_dialog(self, *args, **kwargs):
a = attach.attach(self.session)
a = presenters.attachPresenter(session=self.session, view=views.attachDialog(), interactor=interactors.attachInteractor())
if len(a.attachments) != 0:
self.attachments = a.attachments