def read_data_from_files(self): # Read data from file to code self.FileManButs = readfile_ssh.LoadFile(filename=self.but_filename, path=self.path) self.buts_defs = self.FileManButs.data_from_file self.FileManSched = readfile_ssh.LoadFile(filename=self.sched_filename, path=self.path) self.sched_file = self.FileManSched.data_from_file
def load_data(self): titles = self.titles path = self.path filename = self.filename defaults = self.defaults #self.master.master.master.master.FileManButs self.FileManager = readfile_ssh.LoadFile(path=path, filename=filename, titles=titles, defaults=defaults) self.data_from_file = self.FileManager.data_from_file if self.addrow == 1: self.data_from_file.append( ['' for i in range(len(self.data_from_file[0]))])
def weekly_sched_gui(self, r=0, c=0): header = 'Weekly Schedule' titles = [ 'Task #', 'On/Off', 'Device', 'Day', 'Start Time', 'Stop Time', 'Time Left', 'Skip Run' ] path = self.path filename = self.sched_filename defaults = [1, 1, 1, [3, 4, 5, 6], "23:07:00", "01:08:00", '', 'Hi!'] #import configured devices names into timetable dev_names = readfile_ssh.LoadFile(filename=self.but_filename, path=self.path).data_from_file for dev in dev_names: #device's Aliases to show in timetable self.connected_devices.append(dev[2]) #method does not load file ( it can), but it uses data already loaded self.WeekSched_TimeTable = Generic_UI_Table( self.sched_tab, TimeTable_RowConfig, titles=titles, path=path, filename='', defaults=defaults, header=header, data=self.sched_file, connected_devices=self.connected_devices) self.WeekSched_TimeTable.grid(row=r, column=c) ttk.Button(self.sched_tab, text="Close&Open All GUI", command=self.close_for_reload).grid(row=1, column=0) ttk.Button(self.sched_tab, text="Save Schedule", command=self.save_data_to_file).grid(row=1, column=1) self.write2log("Weekly schedule GUI started")
def load_data_from_file(self): self.data_from_file = readfile_ssh.LoadFile( filename=self.filename).data_from_file if not any(self.data_from_file): self.data_from_file = self.default_data
def save2(self): self.extract_data() readfile_ssh.LoadFile(filename=self.filename).save_to_file( mat=self.data_mat)
def load_pi_list(self, args): self.list_pi = readfile_ssh.LoadFile( **args ).data_from_file #filename=self.filename, path=self.path, **args).data_from_file #self.list_pi.append(['192.168.2.116','Rpi5']) print("IP list to check:\n", self.list_pi)