def check_pep8(self): '''Check the PEP8 from current project ''' proj_dir = get_current_project().path kd_dir = get_kd_dir() pep8_dir = os.path.join(kd_dir, 'tools', 'pep8checker', 'pep8kivy.py') python_path =\ self.designer.designer_settings.config_parser.getdefault( 'global', 'python_shell_path', '' ) if python_path == '': self.profiler.dispatch('on_error', 'Python Shell Path not ' 'specified.' '\n\nUpdate it on \'File\' -> \'Settings\'') return if sys.platform[0] == 'w': pep8_dir = u'"' + pep8_dir + u'"' cmd = '%s %s %s' % (python_path, pep8_dir, proj_dir) self.designer.ui_creator.tab_pannel.switch_to( self.designer.ui_creator.tab_pannel.tab_list[2]) self.designer.ui_creator.kivy_console.run_command(cmd)
def check_pep8(self): '''Check the PEP8 from current project ''' proj_dir = get_current_project().path kd_dir = get_kd_dir() pep8_dir = os.path.join(kd_dir, 'tools', 'pep8checker', 'pep8kivy.py') python_path =\ self.designer.designer_settings.config_parser.getdefault( 'global', 'python_shell_path', '' ) if python_path == '': self.profiler.dispatch( 'on_error', 'Python Shell Path not ' 'specified.' '\n\nUpdate it on \'File\' -> \'Settings\'') return if sys.platform[0] == 'w': pep8_dir = u'"' + pep8_dir + u'"' cmd = '%s %s %s' % (python_path, pep8_dir, proj_dir) self.designer.ui_creator.tab_pannel.switch_to( self.designer.ui_creator.tab_pannel.tab_list[2]) self.designer.ui_creator.kivy_console.run_command(cmd)
def on_adapter_selection_change(self, adapter): '''Event handler for 'on_selection_change' event of adapter. ''' name = adapter.selection[0].text.lower() + '.png' name = name.replace(' and ', '_') image_source = join(NEW_TEMPLATE_IMAGE_PATH, name) _dir = get_kd_dir() image_source = join(_dir, image_source) parent = self.image.parent parent.remove_widget(self.image) self.image = Image(source=image_source) parent.add_widget(self.image) self.prev_selection = adapter.data.index(adapter.selection[0].text)