Использование::
- ml-search.py [-i] [-I] [-t ...] author [-s surname] [-n name] [-m misc-name]
+ ml-search.py [-i] [-I] [-t ...] author [-s surname] [-n name] [-m misc-name] [fullname]
-Искать и печатать список авторов по фамилии, имени и доп. имени (обычно
-отчеству).
+Искать и печатать список авторов по фамилии, имени, доп. имени (обычно
+отчеству) или полному имени.
Опции::
Использование::
- ml-search.py [-i] [-I] [-t ...] ext name
+ ml-search.py [-i] [-I] [-t ...] ext [name]
Искать и печатать список расширений имён файлов по имени.
Использование::
- ml-search.py [-i] [-I] [-t ...] lang name
+ ml-search.py [-i] [-I] [-t ...] lang [name]
Искать и печатать список языков по имени.
Usage::
- ml-search.py [-i] [-I] [-t ...] author [-s surname] [-n name] [-m misc-name]
+ ml-search.py [-i] [-I] [-t ...] author [-s surname] [-n name] [-m misc-name] [fullname]
-Search and print a list of authors by surname/name/misc name.
+Search and print a list of authors by surname/name/misc name/full name.
Options::
Usage::
- ml-search.py [-i] [-I] [-t ...] ext name
+ ml-search.py [-i] [-I] [-t ...] ext [name]
Search and print a list of extensions by name.
Usage::
- ml-search.py [-i] [-I] [-t ...] lang name
+ ml-search.py [-i] [-I] [-t ...] lang [name]
Search and print a list of languages by name.
class Extension(SQLObject):
- name = StringCol(notNull=True, unique=True)
+ name = UnicodeCol(notNull=True, unique=True)
count = IntCol(notNull=True)
count_idx = DatabaseIndex(count)
class Language(SQLObject):
- name = StringCol(notNull=True, unique=True)
+ name = UnicodeCol(notNull=True, unique=True)
count = IntCol(notNull=True)
count_idx = DatabaseIndex(count)
def _search_extensions(case_sensitive, args):
- values = {'name': args.name}
- if case_sensitive is None:
- case_sensitive = _guess_case_sensitivity(values)
+ if args.name:
+ values = {'name': args.name}
+ if case_sensitive is None:
+ case_sensitive = _guess_case_sensitivity(values)
+ else:
+ values = {}
for ext in search_extensions(args.search_type, case_sensitive, values):
print ext.name.encode(default_encoding), \
(u"(%s: %d)" % (_('books'), ext.count)).encode(default_encoding)
def _search_languages(case_sensitive, args):
- values = {'name': args.name}
- if case_sensitive is None:
- case_sensitive = _guess_case_sensitivity(values)
+ if args.name:
+ values = {'name': args.name}
+ if case_sensitive is None:
+ case_sensitive = _guess_case_sensitivity(values)
+ else:
+ values = {}
for lang in search_languages(args.search_type, case_sensitive, values):
print lang.name.encode(default_encoding), \
(u"(%s: %d)" % (_('books'), lang.count)).encode(default_encoding)
parser.set_defaults(func=_search_authors)
parser = subparsers.add_parser('ext', help='Search extensions')
- parser.add_argument('name', help='search by name')
+ parser.add_argument('name', nargs='?', help='search by name')
parser.set_defaults(func=_search_extensions)
parser = subparsers.add_parser('genres', help='Search genres')
parser.set_defaults(func=_search_genres)
parser = subparsers.add_parser('lang', help='Search languages')
- parser.add_argument('name', help='search by name')
+ parser.add_argument('name', nargs='?', help='search by name')
parser.set_defaults(func=_search_languages)
args = main_parser.parse_args()