def probe(self): inputs = get_inputs(self.input_path) inputs = [x for x in inputs if x.has_capability(ABS_MT_POSITION_X)] for device in inputs: pymt_logger.info('ProbeSysfs: found device: %s at %s' % ( device.name, device.device)) # must ignore ? if self.match: if not re.match(self.match, device.name, re.IGNORECASE): pymt_logger.warning('ProbeSysfs: device not match the' ' rule in config, ignoring.') continue devicename = self.device % dict(name=device.device.split(os.path.sep)[-1]) provider = TouchFactory.get(self.provider) if provider is None: pymt_logger.info('ProbeSysfs: unable to found provider %s' % self.provider) pymt_logger.info('ProbeSysfs: fallback on hidinput') provider = TouchFactory.get('hidinput') if provider is None: pymt_logger.critical('ProbeSysfs: no input provider found' ' to handle this device !') continue instance = provider(devicename, '%s,%s' % (device.device, ','.join(self.args))) if instance: pymt.pymt_providers.append(instance)
# Searching the best provider MTWindow = None if not "PYMT_DOC" in os.environ: if "pygame" in pymt.pymt_options["window"]: try: import win_pygame MTWindow = win_pygame.MTWindowPygame pymt_logger.info("Window: use Pygame as window provider.") except ImportError: pymt_logger.debug("Window: Unable to use Pygame as provider.") if MTWindow is None and "glut" in pymt.pymt_options["window"]: try: import win_glut MTWindow = win_glut.MTWindowGlut pymt_logger.info("Window: use GLUT as window provider.") except ImportError: pymt_logger.debug("Window: Unable to use GLUT as provider.") # No window provider ? if MTWindow is None: pymt_logger.critical("Window: No provider found (configuration is %s)" % str(pymt.pymt_options["window"])) # Register all base widgets MTWidgetFactory.register("MTWindow", MTWindow) MTWidgetFactory.register("MTDisplay", MTDisplay)
for touch in getCurrentTouches(): drawCircle(pos=(touch.x, touch.y), radius=self.radius) # Searching the best provider MTWindow = None if not 'PYMT_DOC' in os.environ: if 'pygame' in pymt.pymt_options['window']: try: import win_pygame MTWindow = win_pygame.MTWindowPygame pymt_logger.info('Window: use Pygame as window provider.') except ImportError: pymt_logger.debug('Window: Unable to use Pygame as provider.') if MTWindow is None and 'glut' in pymt.pymt_options['window']: try: import win_glut MTWindow = win_glut.MTWindowGlut pymt_logger.info('Window: use GLUT as window provider.') except ImportError: pymt_logger.debug('Window: Unable to use GLUT as provider.') # No window provider ? if MTWindow is None: pymt_logger.critical('Window: No provider found (configuration is %s)' % str(pymt.pymt_options['window'])) # Register all base widgets MTWidgetFactory.register('MTWindow', MTWindow) MTWidgetFactory.register('MTDisplay', MTDisplay)
def LetThemKnowTheTruth(x): pymt_logger.critical("You have MP3 Files! Those suck! Convert them to ogg and delete them!") pymt_logger.info("btw, if you want to implement an mp3 handler, xelapond would be very appreciative:)") print x del x #Kill the mp3 file
# Searching the best provider MTWindow = None if not 'PYMT_DOC' in os.environ: if 'pygame' in pymt.pymt_options['window']: try: import win_pygame MTWindow = win_pygame.MTWindowPygame pymt_logger.info('Window: use Pygame as window provider.') except ImportError: pymt_logger.debug('Window: Unable to use Pygame as provider.') if MTWindow is None and 'glut' in pymt.pymt_options['window']: try: import win_glut MTWindow = win_glut.MTWindowGlut pymt_logger.info('Window: use GLUT as window provider.') except ImportError: pymt_logger.debug('Window: Unable to use GLUT as provider.') # No window provider ? if MTWindow is None: pymt_logger.critical( 'Window: No provider found (configuration is %s)' % str(pymt.pymt_options['window'])) # Register all base widgets MTWidgetFactory.register('MTWindow', MTWindow) MTWidgetFactory.register('MTDisplay', MTDisplay)