def __init__(self, master=None, **args): super().__init__(master) # Get a cached client to load the dialogs later self.client = get_cached_client() # Set up the frame itself self.master.title('Select a conversation') self.pack() self.create_widgets() # Load previous backups entities self.entities = list(Backuper.enumerate_backups_entities()) self.update_conversation_list() # Load dialogs after the window has loaded (arbitrary 100ms) self.after(ms=100, func=self.on_load)
def __init__(self, master=None, **args): super().__init__(master) # Save our entity and its display self.entity = args['entity'] self.display = sanitize_string(get_display_name(self.entity)) # Get a cached client and initialize a backuper instance with it self.client = get_cached_client() self.backuper = Backuper(self.client, self.entity) self.backuper.on_metadata_change = self.on_metadata_change # Set up the frame itself self.master.title('Backup with {}'.format(self.display)) self.pack(padx=16, pady=16) self.create_widgets() # Download the profile picture in a different thread Thread(target=self.dl_propic).start()
from gui import start_app from gui.windows import SelectDialogWindow from utils import get_cached_client if __name__ == "__main__": # Since this is the first time, it will be loaded and cached get_cached_client() start_app(SelectDialogWindow)
from gui import start_app from gui.windows import SelectDialogWindow from utils import get_cached_client if __name__ == '__main__': # Since this is the first time, it will be loaded and cached get_cached_client() start_app(SelectDialogWindow)