def explore_dir(self, dir_name, current_row): try: t1 = threading.Thread(target=self.explore, args=(dir_name, )) t1.start() t2 = threading.Thread(target=self.progress, args=(current_row, t1)).start() except Exception as e: ft_error(e)
def connect(self): try: self.dirs = self.client.get_name_dirs() files = self.client.get_name_files() self.add_file_rows_to_root(files) except ConnectionRefusedError: raise ConnectionRefusedError except ConnectionResetError: ft_error("Server died :c") self.disconnect() except Exception as e: ft_error(e)
def save(self, file_name, row): """ Скачать что-то с сервера """ try: path: str = filedialog.askdirectory( initialdir="/home/snorcros", title="Select a dir for download", mustexist=1) if path: t1 = threading.Thread(target=self.client.save, args=(file_name, path)) t1.start() t_progr = threading.Thread(target=self.progress, args=(row, t1)).start() ft_done("File " + file_name + " was download to " + path) except ConnectionResetError: ft_error("Server died :c") self.disconnect() except Exception as e: ft_error(e)
def get_params(e1, master): try: global ADDRESS ADDRESS = str(e1.get()) # print(ADDRESS) master.switch_frame(PageOne) except ConnectionRefusedError: ft_error("Server is not available :c") except ValueError: ft_error("Invalid port! Port must be a number!") except Exception as e: ft_error(e)