From: Oleg Broytman Date: Sat, 21 May 2016 14:36:26 +0000 (+0300) Subject: Print the file date, language and file extension X-Git-Tag: 0.0.6~2 X-Git-Url: https://git.phdru.name/?p=m_librarian.git;a=commitdiff_plain;h=008868e3fba7af00b83631666aa5958a23560e57 Print the file date, language and file extension --- diff --git a/docs-ru/command_line.rst b/docs-ru/command_line.rst index 6f3c94b..457338f 100644 --- a/docs-ru/command_line.rst +++ b/docs-ru/command_line.rst @@ -116,7 +116,8 @@ ml-search.py По умолчанию программы выводит список заголовков найденных книг. При использовании опции `-d` также выводится список авторов и жанров, а также серия, к которой принадлежит книга (если принадлежит) и порядковый -номер книги в этой серии. +номер книги в этой серии. С двумя опциями `-d` (`-d -d` или просто +`-dd`) программа выводит дату файла, язык и расширение имени файла. Поиск расширений ^^^^^^^^^^^^^^^^ diff --git a/docs/command_line.rst b/docs/command_line.rst index fdc5f97..1e3adc6 100644 --- a/docs/command_line.rst +++ b/docs/command_line.rst @@ -114,7 +114,8 @@ Options:: By default the program prints only titles of the found book. With one option `-d` it also prints the list of authors and genres, and also series the book belongs to (if any) and the serial number of the book in -the series. +the series. With two options `-d` (`-d -d` or simply `-dd`) it also +prints the file date, language and file extension. Extension search ^^^^^^^^^^^^^^^^ diff --git a/m_librarian/translations/ru_RU.mo b/m_librarian/translations/ru_RU.mo index 07aa518..a9db701 100644 Binary files a/m_librarian/translations/ru_RU.mo and b/m_librarian/translations/ru_RU.mo differ diff --git a/m_librarian/translations/ru_RU.po b/m_librarian/translations/ru_RU.po index 1b81f6c..7937bdb 100644 --- a/m_librarian/translations/ru_RU.po +++ b/m_librarian/translations/ru_RU.po @@ -20,6 +20,15 @@ msgstr "Автор(ы)" msgid "Genre(s)" msgstr "Жанр(ы)" +msgid "Date" +msgstr "Дата" + +msgid "Extension" +msgstr "Расширение" + +msgid "Language" +msgstr "Язык" + msgid "Series" msgstr "Серия" diff --git a/scripts/ml-search.py b/scripts/ml-search.py index bdb1d9d..66606f9 100755 --- a/scripts/ml-search.py +++ b/scripts/ml-search.py @@ -62,7 +62,7 @@ def _search_books(case_sensitive, search_type, args): for book in search_books(search_type, case_sensitive, values, orderBy='title'): print book.title.encode(default_encoding) - if args.details > 0: + if args.details >= 1: print " ", _("Author(s)"), ":", for author in book.authors: names = filter(None, @@ -78,6 +78,10 @@ def _search_books(case_sensitive, search_type, args): print " ", _("Series"), ":", print book.series.encode(default_encoding), \ "(%d)" % book.ser_no + if args.details >= 2: + print " ", _("Date"), ":", book.date + print " ", _("Language"), ":", book.language.name + print " ", _("Extension"), ":", book.extension.name def _search_extensions(case_sensitive, search_type, args):