Esempio n. 1
0
File: cli.py Progetto: lpirl/yana
    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()
Esempio n. 2
0
    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()
Esempio n. 3
0
 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())
Esempio n. 4
0
        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))
Esempio n. 5
0
File: cli.py Progetto: lpirl/yana
 def _init_note_class(self):
     Note.set_parser(self.arg_parser)
Esempio n. 6
0
 def _init_note_class(self):
     Note.set_parser(self.arg_parser)