示例#1
0
    def __init__(self):
        self.user = user()
        self.site = site()

        self.app = QtWidgets.QApplication(sys.argv)
        self.app.setWindowIcon(QtGui.QIcon(defaults._server_ico_black_))

        self.ui_main_server = ui_main_server.Main()
        build.launch_stray_server(self.ui_main_server, self.app)
示例#2
0
 def __init__(self, project_name):
     super(Main, self).__init__()
     # Build the ui from ui converted file
     self.ui = Ui_Form()
     self.ui.setupUi(self)
     self.project_name = project_name
     self.project_path = site_prefs.site().get_project_path_from_name(
         self.project_name)
     self.init_ui()
示例#3
0
 def __init__(self, parent):
     super(Main, self).__init__()
     self.site = site()
     self.user = user()
     QtWidgets.QDialog.__init__(self, parent)
     self.ui = Ui_Dialog()
     self.ui.setupUi(self)
     self.connect_functions()
     self.update_users()
 def __init__(self):
     super(Main, self).__init__()
     # Build the ui from ui converted file
     self.site = site()
     self.user = user()
     self.ui = Ui_Dialog()
     self.ui.setupUi(self)
     self.connect_functions()
     self.init_show_pass_icon()
     qtHandler = log_to_gui.log_viewer(self.ui)
     logger.main_logger.addHandler(qtHandler)
     self.show = 0
 def change(self):
     old_pass = self.ui.old_lineEdit.text()
     project = prefs.project_name
     if not site().project_password_check(project, old_pass):
         logger.error('Wrong password...')
     elif not self.check_confirm():
         logger.error("Passwords doesn't matches...")
     else:
         QApplication.processEvents()
         QApplication.setOverrideCursor(QtCore.Qt.WaitCursor)
         self.ui.change_password_pushButton.setText('Changing password...')
         QApplication.processEvents()
         new_pass = self.ui.new_lineEdit.text()
         encrypted_pass = pwd.encrypt(new_pass)
         site().change_project_password(project, encrypted_pass)
         QApplication.processEvents()
         logger.info('Password changed !')
         QApplication.processEvents()
         self.ui.change_password_pushButton.setText('Password changed !')
         QApplication.processEvents()
         QApplication.restoreOverrideCursor()
示例#6
0
 def __init__(
     self,
     software=None,
 ):
     self.database = util.database()
     self.site = site()
     self.user = user()
     # Check if the given software is valid
     if not software or software not in defaults._softwares_list_:
         logger.warning('Please give a default software...')
     else:
         self.software = software
         # Read the software prefs
         self.settings = self.read_prefs()
示例#7
0
 def __init__(self):
     super(Main, self).__init__()
     # Build the ui from ui converted file
     self.ui = Ui_Dialog()
     self.ui.setupUi(self)
     self.site = site()
     self.user = user()
     self.clean_projects()
     self.connect_functions()
     qtHandler = log_to_gui.log_viewer(self.ui)
     logger.main_logger.addHandler(qtHandler)
     self.ui.project_path_pushButton.setIcon(
         QtGui.QIcon(defaults._folder_icon_))
     self.project_path = None
     self.project_name = None
     self.password = None
示例#8
0
 def __init__(self):
     super(Main, self).__init__()
     # Build the ui from ui converted file
     self.ui = Ui_Dialog()
     self.ui.setupUi(self)
     self.site = site()
     self.image_file = None
     self.get_session_name()
     self.connect_functions()
     self.refresh_promos()
     self.init_avatar_button()
     self.init_show_pass_icon()
     self.avatar = 0
     qtHandler = log_to_gui.log_viewer(self.ui)
     logger.main_logger.addHandler(qtHandler)
     self.show = 0
示例#9
0
from wizard.prefs import asset as asset_prefs
from wizard.prefs import project as project_prefs
from wizard.prefs.user import user
from wizard.prefs.site import site
from wizard.prefs import software as software_prefs
from wizard.prefs.user_events import user_events
from wizard.tools import log
from wizard.vars import defaults
import os

user_prefs = user()
site_prefs = site()

logger = log.pipe_log(__name__)

class prefs:
    def __init__(self):
        self.site = self.site()

    @property
    def user(self):
        return user_prefs.get_user()

    def set_user(self, user_name):
        user_prefs.set_user(user_name)

    @property
    def chat_seen(self):
        return user_prefs.get_seen_dict()

    def set_seen(self, room, message_key):