Beispiel #1
0
 def init_parser(self):
     PythonMySQLConnector.init_parser(self)
     self.parser.add_argument(
         'new_user_id',
         type=int,
         help='id of user to whom sentences will be reassigned')
     self.parser.add_argument(
         'sent_id_listfile',
         help=
         'name of listfile; each line must be the id of a sentence to be reassigned'
     )
Beispiel #2
0
 def init_parser(self):
     PythonMySQLConnector.init_parser(
         self,
         description=
         'Uses a regex to replace instances of a matching pattern',
         epilog=
         'Sample invocation: python regex_replacer.py --json_file config.json --user root --db tatoeba --pwd "" --csv_dir c:\\temp'
     )
     self.parser.add_argument('--csv_basename',
                              default='regex_replacer.csv',
                              help='basename of intermediate csv file')
Beispiel #3
0
 def init_parser(self):
     PythonMySQLConnector.init_parser(self)
     self.parser.add_argument('--base_mp3_dir', default='.',
         help='base directory where mp3 files are stored (e.g., "/home/tatoeba/audio/")')
     self.parser.add_argument('--lang', default='',
         help='3-letter code of language to check (default: check all languages)')
     self.parser.add_argument('--exclude_langs', default='',
         help='comma-separated string of 3-letter codes of languages to exclude (default: none)')
     self.parser.add_argument('--sleep', default=False, action='store_true', help='sleep between row fetches (prevents interface errors)')
     self.parser.add_argument('--db_is_truth', default=False, action='store_true', help='if true, "hasaudio=no" for sentence will cause mp3 file to be removed; otherwise, existing mp3 file will set "hasaudio=shtooka" for sentence')
     self.parser.add_argument('--archive_mp3_dir', default='./archived',
         help='base directory where (possibly bad) mp3 files are archived (e.g., "/home/tatoeba/audio/archived")')
Beispiel #4
0
 def init_parser(self):
     PythonMySQLConnector.init_parser(self)
     self.parser.add_argument(
         '--old_id',
         type=int,
         default=0,
         help='id of sentence with which audio is currently associated')
     self.parser.add_argument(
         '--new_id',
         type=int,
         default=0,
         help='id of sentence to which audio is to be moved')
     self.parser.add_argument(
         '--base_mp3_dir',
         default='.',
         help=
         'base directory where mp3 files are stored (e.g., "/home/tatoeba/audio/")'
     )
     self.parser.add_argument(
         '--old_lang',
         default='',
         help=
         '3-letter code of language with which audio is currently associated'
     )
     self.parser.add_argument(
         '--new_lang',
         default='',
         help=
         '3-letter code of language with which audio is to be associated (usually the same as old_lang'
     )
     self.parser.add_argument(
         '--archive_mp3_dir',
         default='./archived',
         help=
         'base directory where (possibly bad) mp3 files are archived (e.g., "/home/tatoeba/audio/archived")'
     )
Beispiel #5
0
 def __init__(self):
     PythonMySQLConnector.__init__(self)
     self.json_fields = None
Beispiel #6
0
 def process_args(self, argv):
     PythonMySQLConnector.process_args(self, argv)
Beispiel #7
0
 def __init__(self):
     PythonMySQLConnector.__init__(self)
Beispiel #8
0
 def process_args(self, argv):
     PythonMySQLConnector.process_args(self, argv)
     self.excluded_lang_set = set(self.parsed.exclude_langs.split(','))
Beispiel #9
0
 def __init__(self):
     PythonMySQLConnector.__init__(self)
     self.excluded_langs = set([])