def handle_args(self): """ This kicks off the actual operation (i.e. use the users' args, options and sub commands to server the request). """ self._parse_args() args = self.args Note.set_args(args) notes_q = Queue(False) find_process = Process(target=self._find_notes, args=(args.query, notes_q.put)) find_process.start() sub_command = self.sub_commands[args.subcommand] logging.debug("running sub command: '%s'", sub_command.__class__.__name__) try: sub_command.invoke(args, notes_q.get) except KeyboardInterrupt: find_process.terminate() print_default("\n") finally: find_process.join()
def _build_fret_string_table(self, tuning): self._fret_string_table.append(tuning) for f in range(self.num_frets): if f == 0: continue self._fret_string_table.append([]) for s in range(len(tuning)): prev = Note(self._fret_string_table[f-1][s]) prev.inc(True) self._fret_string_table[f].append(prev.to_str())
def found_path_callback(path): """ Initializes ``Note` `from found ``path`` and puts it into the notes queue. This function can easily feature deduplication (and actually did) but I am not quite sure if this is actually desired. """ notes_q_put(Note(path))
def _init_note_class(self): Note.set_parser(self.arg_parser)