kopia lustrzana https://github.com/ctjacobs/pyqso
Renaming set_field to set_data, and get_field_data to get_data, for consistency.
rodzic
d994ca3a2e
commit
aba6bd0dd5
|
@ -156,7 +156,7 @@ class Logbook(Gtk.ListStore):
|
|||
# First append the unique index given to the record.
|
||||
logbook_entry.append(i)
|
||||
for field in self.SELECTED_FIELD_NAMES_TYPES.keys():
|
||||
logbook_entry.append(self.records[i].get_field_data(field))
|
||||
logbook_entry.append(self.records[i].get_data(field))
|
||||
self.append(logbook_entry)
|
||||
|
||||
return
|
||||
|
|
|
@ -143,7 +143,7 @@ class PyQSO(Gtk.Window):
|
|||
# First update the Record object...
|
||||
# (we add 1 onto the column_index here because we don't want to consider the index column)
|
||||
column_name = self.treeview.get_column(column_index+1).get_title()
|
||||
self.logbook.records[row_index].set_field(column_name, data)
|
||||
self.logbook.records[row_index].set_data(column_name, data)
|
||||
# ...and then the Logbook.
|
||||
self.logbook[row_index][column_index+1] = data
|
||||
|
||||
|
@ -162,7 +162,7 @@ class PyQSO(Gtk.Window):
|
|||
record = self.logbook.get_record(index)
|
||||
field_names = self.logbook.SELECTED_FIELD_NAMES_TYPES.keys()
|
||||
for i in range(0, len(field_names)):
|
||||
self.data_entry_panel.set_data(field_names[i], record.get_field_data(field_names[i]))
|
||||
self.data_entry_panel.set_data(field_names[i], record.get_data(field_names[i]))
|
||||
return
|
||||
|
||||
def show_about(self, widget):
|
||||
|
|
|
@ -28,7 +28,7 @@ class Record:
|
|||
self.fields_and_data = fields_and_data
|
||||
logging.debug("New Record instance created!")
|
||||
|
||||
def get_field_data(self, field_name):
|
||||
def get_data(self, field_name):
|
||||
try:
|
||||
data = self.fields_and_data[field_name]
|
||||
except KeyError:
|
||||
|
@ -37,7 +37,7 @@ class Record:
|
|||
data = None
|
||||
return data
|
||||
|
||||
def set_field(self, field_name, data):
|
||||
def set_data(self, field_name, data):
|
||||
# NOTE: If the field_name already exists in the dictionary,
|
||||
# then any data stored there will be over-written.
|
||||
self.fields_and_data[field_name.upper()] = data
|
||||
|
|
Ładowanie…
Reference in New Issue