Python kivy.logger.Logger.debug() Examples
The following are 30
code examples of kivy.logger.Logger.debug().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
kivy.logger.Logger
, or try the search function
.
Example #1
Source File: main.py From kivy-smoothie-host with GNU General Public License v3.0 | 7 votes |
def _upload_gcode(self, file_path, dir_path): if not file_path: return try: self.nlines = Comms.file_len(file_path, self.app.fast_stream) # get number of lines so we can do progress and ETA Logger.debug('MainWindow: number of lines: {}'.format(self.nlines)) except Exception: Logger.warning('MainWindow: exception in file_len: {}'.format(traceback.format_exc())) self.nlines = None self.start_print_time = datetime.datetime.now() self.display('>>> Uploading file: {}, {} lines'.format(file_path, self.nlines)) if not self.app.comms.upload_gcode(file_path, progress=lambda x: self.display_progress(x), done=self._upload_gcode_done): self.display('WARNING Unable to upload file') return else: self.is_printing = True
Example #2
Source File: window_pygame.py From Tickeys-linux with MIT License | 6 votes |
def screenshot(self, *largs, **kwargs): global glReadPixels, GL_RGBA, GL_UNSIGNED_BYTE filename = super(WindowPygame, self).screenshot(*largs, **kwargs) if filename is None: return None if glReadPixels is None: from kivy.graphics.opengl import (glReadPixels, GL_RGBA, GL_UNSIGNED_BYTE) width, height = self.system_size data = glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE) if PY2: data = str(buffer(data)) else: data = bytes(bytearray(data)) surface = pygame.image.fromstring(data, (width, height), 'RGBA', True) pygame.image.save(surface, filename) Logger.debug('Window: Screenshot saved at <%s>' % filename) return filename
Example #3
Source File: main.py From kivy-smoothie-host with GNU General Public License v3.0 | 6 votes |
def enter_wpos(self, axis, v): i = ord(axis) - ord('x') v = v.strip() if v.startswith('/'): # we divide current value by this try: d = float(v[1:]) v = str(self.app.wpos[i] / d) except Exception: Logger.warning("DROWidget: cannot divide by: {}".format(v)) self.app.wpos[i] = self.app.wpos[i] return try: # needed because the filter does not allow -ive numbers WTF!!! f = float(v.strip()) except Exception: Logger.warning("DROWidget: invalid float input: {}".format(v)) # set the display back to what it was, this looks odd but it forces the display to update self.app.wpos[i] = self.app.wpos[i] return Logger.debug("DROWidget: Set axis {} wpos to {}".format(axis, f)) self.app.comms.write('G10 L20 P0 {}{}\n'.format(axis.upper(), f)) self.app.wpos[i] = f
Example #4
Source File: main.py From kivy-smoothie-host with GNU General Public License v3.0 | 6 votes |
def do_action(self, key): if key == 'Send': # Logger.debug("KbdWidget: Sending {}".format(self.display.text)) if self.display.text.strip(): self._add_line_to_log('<< {}'.format(self.display.text)) self.app.comms.write('{}\n'.format(self.display.text)) self.last_command = self.display.text self.display.text = '' elif key == 'Repeat': self.display.text = self.last_command elif key == 'BS': self.display.text = self.display.text[:-1] elif key == '?': self.handle_input('?') else: self.display.text += key
Example #5
Source File: __init__.py From Tickeys-linux with MIT License | 6 votes |
def activate_module(self, name, win): '''Activate a module on a window''' if name not in self.mods: Logger.warning('Modules: Module <%s> not found' % name) return mod = self.mods[name] # ensure the module has been configured if 'module' not in mod: self._configure_module(name) pymod = mod['module'] if not mod['activated']: context = mod['context'] msg = 'Modules: Start <{0}> with config {1}'.format( name, context) Logger.debug(msg) pymod.start(win, context) mod['activated'] = True
Example #6
Source File: linechart.py From RaceCapture_App with GNU General Public License v3.0 | 6 votes |
def _results_has_distance(self, results): distance_values = results.get('Distance') interval_values = results.get('Interval') # Some sanity checking if not (distance_values and interval_values): return False distance_values = distance_values.values interval_values = interval_values.values if not (len(distance_values) > 0 and len(interval_values) > 0): return False # calculate the ratio of total distance / time total_time_ms = interval_values[-1] - interval_values[0] total_distance = distance_values[-1] distance_ratio = total_distance / total_time_ms if total_time_ms > 0 else 0 Logger.debug('Checking distance threshold. Time: {} Distance: {} Ratio: {}'.format(total_time_ms, total_distance, distance_ratio)) return distance_ratio > LineChart.MEANINGFUL_DISTANCE_RATIO_THRESHOLD
Example #7
Source File: cache.py From Tickeys-linux with MIT License | 6 votes |
def register(category, limit=None, timeout=None): '''Register a new category in the cache with the specified limit. :Parameters: `category` : str Identifier of the category. `limit` : int (optional) Maximum number of objects allowed in the cache. If None, no limit is applied. `timeout` : double (optional) Time after which to delete the object if it has not been used. If None, no timeout is applied. ''' Cache._categories[category] = { 'limit': limit, 'timeout': timeout} Cache._objects[category] = {} Logger.debug( 'Cache: register <%s> with limit=%s, timeout=%s' % (category, str(limit), str(timeout)))
Example #8
Source File: window_pygame.py From Tickeys-linux with MIT License | 6 votes |
def screenshot(self, *largs, **kwargs): global glReadPixels, GL_RGBA, GL_UNSIGNED_BYTE filename = super(WindowPygame, self).screenshot(*largs, **kwargs) if filename is None: return None if glReadPixels is None: from kivy.graphics.opengl import (glReadPixels, GL_RGBA, GL_UNSIGNED_BYTE) width, height = self.system_size data = glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE) if PY2: data = str(buffer(data)) else: data = bytes(bytearray(data)) surface = pygame.image.fromstring(data, (width, height), 'RGBA', True) pygame.image.save(surface, filename) Logger.debug('Window: Screenshot saved at <%s>' % filename) return filename
Example #9
Source File: files.py From deepdiy with MIT License | 6 votes |
def add_to_tree(self,*args): if self.path=='': return file_list={} file_list['image']=get_file_list(self.path,formats=['jpg','jpeg','bmp','png']) file_list['video']=get_file_list(self.path,formats=['avi','mp4','tiff','tif']) tree={'node_id':'resources','children':[],'type':'root','display':'text_viewer'} for data_format in file_list: for file_path in file_list[data_format]: tree['children'].append({ 'node_id':file_path.split(os.sep)[-1], 'type':'file_path', 'content':file_path, 'display':data_format+'_viewer', 'children':[]}) self.data.tree=tree if len(self.data.tree['children'])>0: self.data.select_idx=[0,0] else: self.data.select_idx=[0] self.property('data').dispatch(self) Logger.debug('Files: Opened {}'.format(self.path))
Example #10
Source File: datamodel.py From modbus-simulator with Apache License 2.0 | 6 votes |
def reinit(self, **kwargs): """ Re-initializes Datamodel on change in model configuration from settings :param kwargs: :return: """ self.minval = kwargs.get("minval", self.minval) self.maxval = kwargs.get("maxval", self.maxval) time_interval = kwargs.get("time_interval", None) try: if time_interval and int(time_interval) != self.time_interval: self.time_interval = time_interval if self.is_simulating: self.simulate_timer.cancel() self.simulate_timer = BackgroundJob("simulation", self.time_interval, self._simulate_block_values) self.dirty_thread = False self.start_stop_simulation(self.simulate) except ValueError: Logger.debug("Error while reinitializing DataModel %s" % kwargs)
Example #11
Source File: __init__.py From Tickeys-linux with MIT License | 6 votes |
def activate_module(self, name, win): '''Activate a module on a window''' if name not in self.mods: Logger.warning('Modules: Module <%s> not found' % name) return mod = self.mods[name] # ensure the module has been configured if 'module' not in mod: self._configure_module(name) pymod = mod['module'] if not mod['activated']: context = mod['context'] msg = 'Modules: Start <{0}> with config {1}'.format( name, context) Logger.debug(msg) pymod.start(win, context) mod['activated'] = True
Example #12
Source File: telemetryconnection.py From RaceCapture_App with GNU General Public License v3.0 | 6 votes |
def start(self): Logger.info("TelemetryManager: start() telemetry_enabled: " + str(self.telemetry_enabled) + " cell_enabled: " + str(self.cell_enabled)) self._auth_failed = False if self._should_connect: if self._connection_process and not self._connection_process.is_alive(): Logger.info("TelemetryManager: connection process is dead") self._connect() elif not self._connection_process: if self.device_id and self.channels: Logger.debug("TelemetryManager: starting telemetry thread") self._connect() else: Logger.warning('TelemetryManager: Device id, channels missing or RCP cell enabled ' 'when attempting to start. Aborting.') else: Logger.warning('TelemetryManager: self._should_connect is false, not connecting') # Creates new TelemetryConnection in separate thread
Example #13
Source File: telemetryconnection.py From RaceCapture_App with GNU General Public License v3.0 | 5 votes |
def stop(self): Logger.debug("TelemetryManager: stop()") if self._retry_timer: self._retry_timer.cancel() if self.connection: self.connection.end() try: self._connection_process.join(1) except: pass
Example #14
Source File: telemetryconnection.py From RaceCapture_App with GNU General Public License v3.0 | 5 votes |
def _on_meta(self, channel_metas): Logger.debug("TelemetryManager: Got meta") # Isolate the data from the calling thread by making a copy channel_metas_copy = copy(channel_metas) self.channels = channel_metas_copy # Event handler for when self.channels changes, don't restart connection b/c # the TelemetryConnection object will handle new channels
Example #15
Source File: telemetryconnection.py From RaceCapture_App with GNU General Public License v3.0 | 5 votes |
def _connect(self): Logger.info("TelemetryManager: starting connection") self.dispatch('on_connecting', "Connecting to Podium") self.connection = TelemetryConnection(self.host, self.port, self.device_id, self.channels, self._data_bus, self.status, self.api_msg) self._connection_process = threading.Thread(target=self.connection.run) self._connection_process.daemon = True self._connection_process.start() Logger.debug("TelemetryManager: thread started")
Example #16
Source File: wirelessconfigview.py From RaceCapture_App with GNU General Public License v3.0 | 5 votes |
def _on_views_modified(self, *args): Logger.debug("WirelessConfigView: _on_views_modified args: {}".format(args)) Logger.debug("Got view modified") self.dispatch('on_config_modified')
Example #17
Source File: wificonfigview.py From RaceCapture_App with GNU General Public License v3.0 | 5 votes |
def on_client_mode_enable_change(self, instance, value): Logger.debug("WirelessConfigView: client mode change: {}".format(value)) if self.wifi_config: self.wifi_config.client_mode_active = value self.wifi_config.stale = True self._wifi_modified()
Example #18
Source File: wificonfigview.py From RaceCapture_App with GNU General Public License v3.0 | 5 votes |
def config_updated(self, config): self.wifi_config = config.wifi_config Logger.debug("WifiConfig: got config: {}".format(self.wifi_config.to_json())) wifi_switch = self.ids.wifi_enabled wifi_switch.setControl(SettingsSwitch(active=self.wifi_config.active)) wifi_switch.control.bind(active=self.on_wifi_enable_change) wifi_client_switch = self.ids.client_mode wifi_client_switch.setControl(SettingsSwitch(active=self.wifi_config.client_mode_active)) wifi_client_switch.control.bind(active=self.on_client_mode_enable_change) wifi_ap_switch = self.ids.ap_mode wifi_ap_switch.setControl(SettingsSwitch(active=self.wifi_config.ap_mode_active)) wifi_ap_switch.control.bind(active=self.on_ap_mode_enable_change) ap_encryption = self.ids.ap_encryption ap_encryption.bind(on_setting=self.on_ap_encryption) encryption_spinner = SettingsMappedSpinner() self.load_ap_encryption_spinner(encryption_spinner, self.wifi_config.ap_encryption) ap_encryption.setControl(encryption_spinner) self.ids.ap_password.disabled = config.wifi_config.ap_encryption == 'none' ap_channel = self.ids.ap_channel channel_spinner = SettingsMappedSpinner() self.build_ap_channel_spinner(channel_spinner, str(self.wifi_config.ap_channel)) ap_channel.bind(on_setting=self.on_ap_channel) ap_channel.setControl(channel_spinner) self.ids.client_ssid.text = self.wifi_config.client_ssid self.ids.client_password.text = self.wifi_config.client_password self.ids.ap_ssid.text = self.wifi_config.ap_ssid self.ids.ap_password.text = self.wifi_config.ap_password
Example #19
Source File: wificonfigview.py From RaceCapture_App with GNU General Public License v3.0 | 5 votes |
def on_wifi_enable_change(self, instance, value): Logger.debug("WifiConfigView: got wifi enabled change") if self.wifi_config: self.wifi_config.active = value self.wifi_config.stale = True self._wifi_modified()
Example #20
Source File: imuview.py From RaceCapture_App with GNU General Public License v3.0 | 5 votes |
def on_touch_move(self, touch): Logger.debug("dx: %s, dy: %s. Widget: (%s, %s)" % (touch.dx, touch.dy, self.width, self.height)) self._total_drag_distance += abs(touch.dx) + abs(touch.dy) if touch in self._touches and touch.grab_current == self: if len(self._touches) == 1: # here do just rotation ax, ay = self.define_rotate_angle(touch) self.rotation_x -= (ay * ImuView.ROTATION_SCALING) self.rotation_y += (ax * ImuView.ROTATION_SCALING) # ax, ay = math.radians(ax), math.radians(ay) elif len(self._touches) == 2: # scaling here # use two touches to determine do we need scal touch1, touch2 = self._touches old_pos1 = (touch1.x - touch1.dx, touch1.y - touch1.dy) old_pos2 = (touch2.x - touch2.dx, touch2.y - touch2.dy) old_dx = old_pos1[0] - old_pos2[0] old_dy = old_pos1[1] - old_pos2[1] old_distance = (old_dx * old_dx + old_dy * old_dy) new_dx = touch1.x - touch2.x new_dy = touch1.y - touch2.y new_distance = (new_dx * new_dx + new_dy * new_dy) if new_distance > old_distance: scale = 1 * self._zoom_scaling elif new_distance == old_distance: scale = 0 else: scale = -1 * self._zoom_scaling if scale: self.position_z += scale
Example #21
Source File: {{cookiecutter.repo_name}}.py From cookiedozer with MIT License | 5 votes |
def _update_timer(self, dt): try: self.timer += 1 except ValueError: self.stop_timer() self.carousel.load_next() Logger.debug("Automatically loading next slide")
Example #22
Source File: {{cookiecutter.repo_name}}.py From cookiedozer with MIT License | 5 votes |
def stop_timer(self, *args, **kwargs): """Reset the timer and unschedule the update routine.""" Logger.debug("Stopping timer") Clock.unschedule(self._update_timer) self.progress_bar.fade_out() self.timer = 0
Example #23
Source File: {{cookiecutter.repo_name}}.py From cookiedozer with MIT License | 5 votes |
def start_timer(self, *args, **kwargs): """Schedule the timer update routine and fade in the progress bar.""" Logger.debug("Starting timer") Clock.schedule_interval(self._update_timer, self.timer_interval) self.progress_bar.fade_in()
Example #24
Source File: display_mgr.py From deepdiy with MIT License | 5 votes |
def update_display_panel(self,*args): '''Switch to corresponding display screen, give the viewer selected data''' selected_data=self.data.get_selected_data() if 'display' in selected_data: # some data may not have display property display_panel=self.app.widget_manager.ids.display_screens display_panel.current=selected_data['display'] display_panel.children[0].children[0].data=selected_data Logger.debug('Display Manager: show {} in {}'.format(selected_data['node_id'],selected_data['display']))
Example #25
Source File: display_mgr.py From deepdiy with MIT License | 5 votes |
def update_resource_tree(self,*args): '''Catch the instance of ResourceTree plugin, give it new data, and tell it to update''' resource_tree=self.app.plugins['resource_tree']['instance'] resource_tree.data=self.data resource_tree.property('data').dispatch(resource_tree) Logger.debug('Display Manager: Update Resource Tree')
Example #26
Source File: video_pygst.py From Tickeys-linux with MIT License | 5 votes |
def load(self): Logger.debug('VideoPyGst: Load <%s>' % self._filename) self._playbin.set_state(gst.STATE_NULL) self._playbin.set_property('uri', self._get_uri()) self._playbin.set_state(gst.STATE_READY)
Example #27
Source File: video_pygst.py From Tickeys-linux with MIT License | 5 votes |
def _on_gst_message(bus, message): Logger.trace('VideoPyGst: (bus) %s' % str(message)) # log all error messages if message.type == gst.MESSAGE_ERROR: error, debug = list(map(str, message.parse_error())) Logger.error('VideoPyGst: %s' % error) Logger.debug('VideoPyGst: %s' % debug)
Example #28
Source File: video_gi.py From Tickeys-linux with MIT License | 5 votes |
def load(self): Logger.debug('VideoGi: Load <{}>'.format(self._filename)) self._playbin.set_state(Gst.State.NULL) self._playbin.props.uri = self._get_uri() self._playbin.set_state(Gst.State.READY)
Example #29
Source File: video_gi.py From Tickeys-linux with MIT License | 5 votes |
def _on_gst_message(bus, message): Logger.trace('VideoGi: (bus) {}'.format(message)) # log all error messages if message.type == Gst.MessageType.ERROR: error, debug = list(map(str, message.parse_error())) Logger.error('VideoGi: {}'.format(error)) Logger.debug('VideoGi: {}'.format(debug))
Example #30
Source File: audio_pygst.py From Tickeys-linux with MIT License | 5 votes |
def _on_gst_message(self, bus, message): t = message.type if t == gst.MESSAGE_EOS: self._data.set_state(gst.STATE_NULL) if self.loop: self.play() else: self.stop() elif t == gst.MESSAGE_ERROR: self._data.set_state(gst.STATE_NULL) err, debug = message.parse_error() Logger.error('AudioPyGst: %s' % err) Logger.debug(str(debug)) self.stop()