Removed some platform checks

This commit is contained in:
2022-11-03 17:11:13 -06:00
parent b8637ba8ca
commit 1ded773e84
24 changed files with 67 additions and 246 deletions

View File

@@ -7,4 +7,3 @@ Contents of this package:
manager: Handles multiple sessions, setting the configuration files and check if the session is valid. Part of the model.
session: Creates a twitter session for an user. The other part of the model.
"""
from __future__ import unicode_literals

View File

@@ -1,57 +0,0 @@
from __future__ import unicode_literals
from gi.repository import Gtk
import widgetUtils
class sessionManagerWindow(widgetUtils.baseDialog):
def __init__(self):
super(sessionManagerWindow, self).__init__("Session Manager", None, 0, (Gtk.STOCK_OK, widgetUtils.OK, Gtk.STOCK_CANCEL, widgetUtils.CANCEL))
self.list = widgetUtils.list("Session")
self.box.add(self.list.list)
btnBox = Gtk.Box(spacing=6)
self.new = Gtk.Button("New account")
self.remove = Gtk.Button("Remove account")
self.configuration = Gtk.Button("Configuration")
btnBox.add(self.new)
btnBox.add(self.remove)
btnBox.add(self.configuration)
self.box.add(btnBox)
self.show_all()
def fill_list(self, sessionsList):
for i in sessionsList:
self.list.insert_item(False, i)
if self.list.get_count() > 0:
self.list.select_item(0)
def new_account_dialog(self):
dialog = Gtk.MessageDialog(self, 0, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, "Authorization")
dialog.format_secondary_text("The request to authorize your Twitter account will be opened in your browser. You only need to do this once. Would you like to continue?")
answer = dialog.run()
dialog.destroy()
return answer
def add_new_session_to_list(self):
total = self.list.get_count()
name = "Authorized account %d" % (total+1)
self.list.insert_item(name)
if self.list.get_count() == 1:
self.list.select_item(0)
def show_unauthorised_error(self):
dialog = Gtk.MessageDialog(self, 0, Gtk.MessageType.ERROR, Gtk.ButtonsType.CANCEL, "Invalid user token")
dialog.format_secondary_text("Your access token is invalid or the authorization has failed. Please try again.")
answer = dialog.run()
return answer
def remove_account_dialog(self):
dialog = Gtk.MessageDialog(self, 0, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, "Remove account")
dialog.format_secondary_text("Do you really want delete this account?")
answer = dialog.run()
return answer
def get_selected(self):
return self.list.get_selected()
def remove_session(self, sessionID):
self.list.remove_item(sessionID)

View File

@@ -1,13 +1,9 @@
# -*- coding: utf-8 -*-
import shutil
import widgetUtils
import platform
import output
if platform.system() == "Windows":
from . import wxUI as view
from controller import settings
elif platform.system() == "Linux":
from . import gtkUI as view
from . import wxUI as view
from controller import settings
import paths
import time
import os