diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-08-26 00:13:36 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-08-26 18:27:21 -0400 |
commit | d8c75fc608cdc510d432a2b2b84ac82cfce5faa5 (patch) | |
tree | ea66f89c5f24df3fa6a5683e97baa7c3107ee272 /klippy | |
parent | a42cb4fecfbf8f4319b0b2d04c69ecec7e1b8ff5 (diff) | |
download | kutter-d8c75fc608cdc510d432a2b2b84ac82cfce5faa5.tar.gz kutter-d8c75fc608cdc510d432a2b2b84ac82cfce5faa5.tar.xz kutter-d8c75fc608cdc510d432a2b2b84ac82cfce5faa5.zip |
klippy: Rename internal functions so that they are prefaced with "_"
Preface the internal functions to make it more clear which functions
are interfaces to external code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r-- | klippy/klippy.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/klippy/klippy.py b/klippy/klippy.py index f674720b..6b069b3c 100644 --- a/klippy/klippy.py +++ b/klippy/klippy.py @@ -131,9 +131,9 @@ class Printer: self.reactor = reactor.Reactor() self.objects = {} self.gcode = gcode.GCodeParser(self, input_fd) - self.stats_timer = self.reactor.register_timer(self.stats) + self.stats_timer = self.reactor.register_timer(self._stats) self.connect_timer = self.reactor.register_timer( - self.connect, self.reactor.NOW) + self._connect, self.reactor.NOW) self.all_config_options = {} self.need_dump_debug = False self.state_message = message_startup @@ -142,7 +142,7 @@ class Printer: self.mcu = None def get_start_args(self): return self.start_args - def stats(self, eventtime, force_output=False): + def _stats(self, eventtime, force_output=False): if self.need_dump_debug: # Call dump_debug here so it is executed in the main thread self.gcode.dump_debug() @@ -161,7 +161,7 @@ class Printer: return eventtime + 1. def add_object(self, name, obj): self.objects[name] = obj - def load_config(self): + def _load_config(self): self.fileconfig = ConfigParser.RawConfigParser() config_file = self.start_args['config_file'] res = self.fileconfig.read(config_file) @@ -188,9 +188,9 @@ class Printer: raise ConfigParser.Error( "Unknown option '%s' in section '%s'" % ( option, section)) - def connect(self, eventtime): + def _connect(self, eventtime): try: - self.load_config() + self._load_config() if self.start_args.get('debugoutput') is None: self.reactor.update_timer(self.stats_timer, self.reactor.NOW) self.mcu.connect() @@ -241,14 +241,14 @@ class Printer: def disconnect(self): try: if self.mcu is not None: - self.stats(self.reactor.monotonic(), force_output=True) + self._stats(self.reactor.monotonic(), force_output=True) self.mcu.disconnect() except: logging.exception("Unhandled exception during disconnect") def firmware_restart(self): try: if self.mcu is not None: - self.stats(self.reactor.monotonic(), force_output=True) + self._stats(self.reactor.monotonic(), force_output=True) self.mcu.microcontroller_restart() self.mcu.disconnect() except: |