Попытка сделать нормальный поиск
This commit is contained in:
15
manage.py
15
manage.py
@@ -3,7 +3,8 @@
|
||||
import optparse
|
||||
|
||||
from aore.aoutils.aoupdater import AoUpdater
|
||||
from aore.miscutils.sphinx import produce_sphinx_config
|
||||
from aore.miscutils.sphinx import configure_sphinx
|
||||
from aore.fias.search import SphinxSearch
|
||||
|
||||
|
||||
def update_base(xml_source, updates_count):
|
||||
@@ -25,8 +26,11 @@ def main():
|
||||
help="Count of updates to process, only for '--database update' option")
|
||||
p.add_option('--source', '-s', default="http",
|
||||
help="Create/update DB from source. Value: \"http\" or absolute path to folder")
|
||||
p.add_option('--sphinx-configure', '-c', action="store", type="string",
|
||||
help="Get Sphinx config. Value: /path/to/sphinx.conf")
|
||||
p.add_option('--sphinx-configure', '-c', action="store_true", dest="sphinx", default="False",
|
||||
help="Configure sphinx. Creates sphinx.conf in working direcory")
|
||||
p.add_option('--indexer-path', '-i',
|
||||
help="Path to sphinx indexer binary. Must be specified for '--sphinx-configure'")
|
||||
|
||||
options, arguments = p.parse_args()
|
||||
|
||||
if options.database:
|
||||
@@ -37,9 +41,8 @@ def main():
|
||||
if options.database == "update":
|
||||
update_base(options.source, int(options.update_count))
|
||||
|
||||
if options.sphinx_configure:
|
||||
produce_sphinx_config(options.sphinx_configure)
|
||||
|
||||
if options.sphinx and options.indexer_path:
|
||||
configure_sphinx(options.indexer_path)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user