kopia lustrzana https://github.com/ctjacobs/pyqso
Removed unnecessary debugging statements.
rodzic
f3a7888183
commit
2ddfc2d061
|
@ -26,11 +26,11 @@ PyQSO is a contact logging tool for amateur radio operators.
|
||||||
Installation and running
|
Installation and running
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
Assuming that the current working directory is PyQSO's base directory (the directory that the Makefile is in), PyQSO can be installed via the terminal with the following command:
|
Assuming that the current working directory is PyQSO's base directory (the directory that the `Makefile` is in), PyQSO can be installed via the terminal with the following command:
|
||||||
|
|
||||||
make install
|
make install
|
||||||
|
|
||||||
Note: 'sudo' may be needed for this. Once installed, the following command will run PyQSO:
|
Note: `sudo` may be needed for this. Once installed, the following command will run PyQSO:
|
||||||
|
|
||||||
pyqso
|
pyqso
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,11 @@ from gi.repository import Gtk
|
||||||
|
|
||||||
|
|
||||||
class Blank(object):
|
class Blank(object):
|
||||||
|
|
||||||
|
""" A blank page in the logbook for the "+" (New Log) tab. """
|
||||||
|
|
||||||
def __init__(self, application):
|
def __init__(self, application):
|
||||||
""" Create a blank page in the Gtk.Notebook for the "+" (New Log) tab.
|
""" Create the blank page.
|
||||||
|
|
||||||
:arg application: The PyQSO application containing the main Gtk window, etc.
|
:arg application: The PyQSO application containing the main Gtk window, etc.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -43,7 +43,7 @@ class Cabrillo:
|
||||||
:returns: None
|
:returns: None
|
||||||
:raises IOError: if the Cabrillo file cannot be written (e.g. due to lack of write permissions)."""
|
:raises IOError: if the Cabrillo file cannot be written (e.g. due to lack of write permissions)."""
|
||||||
|
|
||||||
logging.debug("Writing records to an Cabrillo file...")
|
logging.debug("Writing records to a Cabrillo file...")
|
||||||
try:
|
try:
|
||||||
f = open(path, mode='w', errors="replace") # Open file for writing
|
f = open(path, mode='w', errors="replace") # Open file for writing
|
||||||
|
|
||||||
|
|
|
@ -30,14 +30,14 @@ class CalendarDialog:
|
||||||
|
|
||||||
:arg application: The PyQSO application containing the main Gtk window, etc.
|
:arg application: The PyQSO application containing the main Gtk window, etc.
|
||||||
"""
|
"""
|
||||||
logging.debug("Setting up the calendar dialog...")
|
|
||||||
self.builder = application.builder
|
self.builder = application.builder
|
||||||
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
|
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
|
||||||
self.builder.add_objects_from_file(glade_file_path, ("calendar_dialog",))
|
self.builder.add_objects_from_file(glade_file_path, ("calendar_dialog",))
|
||||||
self.dialog = self.builder.get_object("calendar_dialog")
|
self.dialog = self.builder.get_object("calendar_dialog")
|
||||||
self.calendar = self.builder.get_object("calendar")
|
self.calendar = self.builder.get_object("calendar")
|
||||||
self.dialog.show_all()
|
self.dialog.show_all()
|
||||||
logging.debug("Calendar dialog ready!")
|
|
||||||
return
|
return
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -26,13 +26,13 @@ from pyqso.adif import AVAILABLE_FIELD_NAMES_ORDERED
|
||||||
|
|
||||||
class Log(Gtk.ListStore):
|
class Log(Gtk.ListStore):
|
||||||
|
|
||||||
""" A single log inside of the whole logbook. A Log object can store multiple Record objects. """
|
""" A single log inside of the whole logbook. A Log object can store multiple records. This is """
|
||||||
|
|
||||||
def __init__(self, connection, name):
|
def __init__(self, connection, name):
|
||||||
""" Set up a new Log object.
|
""" Set up a new Log object.
|
||||||
|
|
||||||
:arg connection: An sqlite database connection.
|
:arg connection: An sqlite database connection.
|
||||||
:arg str name: The name of the log (i.e. the sqlite table name).
|
:arg str name: The name of the log (i.e. the database table name).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# The ListStore constructor needs to know the data types of the columns.
|
# The ListStore constructor needs to know the data types of the columns.
|
||||||
|
@ -44,7 +44,6 @@ class Log(Gtk.ListStore):
|
||||||
self.connection = connection
|
self.connection = connection
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
logging.debug("New Log instance created!")
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def populate(self):
|
def populate(self):
|
||||||
|
|
|
@ -54,7 +54,7 @@ class Logbook:
|
||||||
self.notebook = self.builder.get_object("logbook")
|
self.notebook = self.builder.get_object("logbook")
|
||||||
self.connection = None
|
self.connection = None
|
||||||
self.logs = []
|
self.logs = []
|
||||||
logging.debug("New Logbook instance created!")
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def new(self, widget=None):
|
def new(self, widget=None):
|
||||||
|
|
|
@ -28,7 +28,7 @@ import os.path
|
||||||
|
|
||||||
class Menu:
|
class Menu:
|
||||||
|
|
||||||
""" The PyQSO menu bar along the top of the main window. """
|
""" The menu bar along the top of the main window. """
|
||||||
|
|
||||||
def __init__(self, application):
|
def __init__(self, application):
|
||||||
""" Set up all menu items and connect to the various functions.
|
""" Set up all menu items and connect to the various functions.
|
||||||
|
@ -36,8 +36,6 @@ class Menu:
|
||||||
:arg application: The PyQSO application containing the main Gtk window, etc.
|
:arg application: The PyQSO application containing the main Gtk window, etc.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
logging.debug("Setting up the menu bar...")
|
|
||||||
|
|
||||||
self.application = application
|
self.application = application
|
||||||
self.builder = self.application.builder
|
self.builder = self.application.builder
|
||||||
|
|
||||||
|
@ -131,8 +129,6 @@ class Menu:
|
||||||
self.set_log_items_sensitive(False)
|
self.set_log_items_sensitive(False)
|
||||||
self.set_record_items_sensitive(False)
|
self.set_record_items_sensitive(False)
|
||||||
|
|
||||||
logging.debug("Menu bar ready!")
|
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def set_logbook_item_sensitive(self, sensitive):
|
def set_logbook_item_sensitive(self, sensitive):
|
||||||
|
@ -140,11 +136,10 @@ class Menu:
|
||||||
|
|
||||||
:arg bool sensitive: If True, enable the 'new logbook' and 'open logbook' menu items. If False, disable them.
|
:arg bool sensitive: If True, enable the 'new logbook' and 'open logbook' menu items. If False, disable them.
|
||||||
"""
|
"""
|
||||||
logging.debug("Setting the 'Create/Open Logbook' menu item's sensitivity to: %s..." % sensitive)
|
|
||||||
self.items["NEW_LOGBOOK"].set_sensitive(sensitive)
|
self.items["NEW_LOGBOOK"].set_sensitive(sensitive)
|
||||||
self.items["OPEN_LOGBOOK"].set_sensitive(sensitive)
|
self.items["OPEN_LOGBOOK"].set_sensitive(sensitive)
|
||||||
self.items["CLOSE_LOGBOOK"].set_sensitive(not sensitive)
|
self.items["CLOSE_LOGBOOK"].set_sensitive(not sensitive)
|
||||||
logging.debug("Set the 'Create/Open Logbook' menu item's sensitivity to: %s." % sensitive)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def set_log_items_sensitive(self, sensitive):
|
def set_log_items_sensitive(self, sensitive):
|
||||||
|
@ -152,10 +147,9 @@ class Menu:
|
||||||
|
|
||||||
:arg bool sensitive: If True, enable all the log-related menu items. If False, disable them all.
|
:arg bool sensitive: If True, enable all the log-related menu items. If False, disable them all.
|
||||||
"""
|
"""
|
||||||
logging.debug("Setting log-related menu item sensitivity to: %s..." % sensitive)
|
|
||||||
for item_name in ["NEW_LOG", "DELETE_LOG", "RENAME_LOG", "IMPORT_LOG", "EXPORT_LOG_ADIF", "EXPORT_LOG_CABRILLO", "PRINT_LOG"]:
|
for item_name in ["NEW_LOG", "DELETE_LOG", "RENAME_LOG", "IMPORT_LOG", "EXPORT_LOG_ADIF", "EXPORT_LOG_CABRILLO", "PRINT_LOG"]:
|
||||||
self.items[item_name].set_sensitive(sensitive)
|
self.items[item_name].set_sensitive(sensitive)
|
||||||
logging.debug("Set log-related menu item sensitivity to: %s." % sensitive)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def set_record_items_sensitive(self, sensitive):
|
def set_record_items_sensitive(self, sensitive):
|
||||||
|
@ -163,8 +157,7 @@ class Menu:
|
||||||
|
|
||||||
:arg bool sensitive: If True, enable all the record-related menu items. If False, disable them all.
|
:arg bool sensitive: If True, enable all the record-related menu items. If False, disable them all.
|
||||||
"""
|
"""
|
||||||
logging.debug("Setting record-related menu item sensitivity to: %s..." % sensitive)
|
|
||||||
for item_name in ["ADD_RECORD", "EDIT_RECORD", "DELETE_RECORD", "REMOVE_DUPLICATES", "RECORD_COUNT"]:
|
for item_name in ["ADD_RECORD", "EDIT_RECORD", "DELETE_RECORD", "REMOVE_DUPLICATES", "RECORD_COUNT"]:
|
||||||
self.items[item_name].set_sensitive(sensitive)
|
self.items[item_name].set_sensitive(sensitive)
|
||||||
logging.debug("Set record-related menu item sensitivity to: %s." % sensitive)
|
|
||||||
return
|
return
|
||||||
|
|
|
@ -31,8 +31,6 @@ class TelnetConnectionDialog:
|
||||||
:arg application: The PyQSO application containing the main Gtk window, etc.
|
:arg application: The PyQSO application containing the main Gtk window, etc.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
logging.debug("Building new Telnet connection dialog...")
|
|
||||||
|
|
||||||
self.builder = application.builder
|
self.builder = application.builder
|
||||||
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
|
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
|
||||||
self.builder.add_objects_from_file(glade_file_path, ("telnet_connection_dialog",))
|
self.builder.add_objects_from_file(glade_file_path, ("telnet_connection_dialog",))
|
||||||
|
@ -45,8 +43,6 @@ class TelnetConnectionDialog:
|
||||||
|
|
||||||
self.dialog.show_all()
|
self.dialog.show_all()
|
||||||
|
|
||||||
logging.debug("Telnet connection dialog built.")
|
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -30,8 +30,6 @@ class Toolbar:
|
||||||
:arg application: The PyQSO application containing the main Gtk window, etc.
|
:arg application: The PyQSO application containing the main Gtk window, etc.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
logging.debug("Setting up the toolbar...")
|
|
||||||
|
|
||||||
self.application = application
|
self.application = application
|
||||||
self.builder = self.application.builder
|
self.builder = self.application.builder
|
||||||
|
|
||||||
|
@ -70,8 +68,6 @@ class Toolbar:
|
||||||
self.set_record_buttons_sensitive(False)
|
self.set_record_buttons_sensitive(False)
|
||||||
self.filter_source.set_sensitive(False)
|
self.filter_source.set_sensitive(False)
|
||||||
|
|
||||||
logging.debug("Toolbar ready!")
|
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def set_logbook_button_sensitive(self, sensitive):
|
def set_logbook_button_sensitive(self, sensitive):
|
||||||
|
@ -79,11 +75,9 @@ class Toolbar:
|
||||||
|
|
||||||
:arg bool sensitive: If True, enable the 'new logbook' and 'open logbook' toolbar items. If False, disable them.
|
:arg bool sensitive: If True, enable the 'new logbook' and 'open logbook' toolbar items. If False, disable them.
|
||||||
"""
|
"""
|
||||||
logging.debug("Setting logbook-related toolbar item sensitivity to: %s..." % sensitive)
|
|
||||||
self.buttons["NEW_LOGBOOK"].set_sensitive(sensitive)
|
self.buttons["NEW_LOGBOOK"].set_sensitive(sensitive)
|
||||||
self.buttons["OPEN_LOGBOOK"].set_sensitive(sensitive)
|
self.buttons["OPEN_LOGBOOK"].set_sensitive(sensitive)
|
||||||
self.buttons["CLOSE_LOGBOOK"].set_sensitive(not sensitive)
|
self.buttons["CLOSE_LOGBOOK"].set_sensitive(not sensitive)
|
||||||
logging.debug("Set logbook-related toolbar item sensitivity to: %s." % sensitive)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def set_record_buttons_sensitive(self, sensitive):
|
def set_record_buttons_sensitive(self, sensitive):
|
||||||
|
@ -91,8 +85,6 @@ class Toolbar:
|
||||||
|
|
||||||
:arg bool sensitive: If True, enable all the record-related toolbar items. If False, disable them all.
|
:arg bool sensitive: If True, enable all the record-related toolbar items. If False, disable them all.
|
||||||
"""
|
"""
|
||||||
logging.debug("Setting record-related toolbar item sensitivity to: %s..." % sensitive)
|
|
||||||
for button_name in ["ADD_RECORD", "EDIT_RECORD", "DELETE_RECORD"]:
|
for button_name in ["ADD_RECORD", "EDIT_RECORD", "DELETE_RECORD"]:
|
||||||
self.buttons[button_name].set_sensitive(sensitive)
|
self.buttons[button_name].set_sensitive(sensitive)
|
||||||
logging.debug("Set record-related toolbar item sensitivity to: %s." % sensitive)
|
|
||||||
return
|
return
|
||||||
|
|
|
@ -34,8 +34,6 @@ class Toolbox:
|
||||||
:arg application: The PyQSO application containing the main Gtk window, etc.
|
:arg application: The PyQSO application containing the main Gtk window, etc.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
logging.debug("Setting up the toolbox...")
|
|
||||||
|
|
||||||
self.application = application
|
self.application = application
|
||||||
self.builder = self.application.builder
|
self.builder = self.application.builder
|
||||||
|
|
||||||
|
@ -47,8 +45,6 @@ class Toolbox:
|
||||||
|
|
||||||
self.tools.connect_after("switch-page", self.on_switch_page)
|
self.tools.connect_after("switch-page", self.on_switch_page)
|
||||||
|
|
||||||
logging.debug("Toolbox ready!")
|
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def toggle_visible_callback(self, widget=None):
|
def toggle_visible_callback(self, widget=None):
|
||||||
|
|
Ładowanie…
Reference in New Issue