def run(fsphinx_config='', sim_config='', from_dir='', port='', no_debug=False): if fsphinx_config: cl = FSphinxClient.FromConfig(fsphinx_config) else: cl = None if sim_config: sim_cl = SimClient.FromConfig(sim_config) else: sim_cl = None if no_debug: autoreload = False else: autoreload = True if from_dir: app = CloudMiningApp.from_directory(from_dir, cl=cl, sim_cl=sim_cl, autoreload=autoreload) else: app = CloudMiningApp(cl, sim_cl, autoreload=autoreload) if port: app.set_port(port) if no_debug: app.debug = False app.template_caching = True app.run()
#!/usr/bin/env python from cloudmining import CloudMiningApp # assumes a default directory structure app = CloudMiningApp.from_directory('/home/letterlocked/CloudMining/examples/imdb', autoreload=True) # what sorting options are shown (key must match cl sort options) app.set_ui_sort_by( dict(key='pop', description='popularity'), dict(key='dat', description='date'), dict(key='rat', description='user ratings'), dict(key='vot', description='number of votes') ) # you can reorder the facets and change default look here # name must match the sphinx client facet names app.set_ui_facets( dict(name='year', color='purple', collapsed=True, visualization='rose'), dict(name='genre', color='green', visualization='counts'), dict(name='keyword', color='black', visualization='counts'), dict(name='director', color='blue', visualization='counts'), dict(name='actor', color='red', visualization='counts'), ) # some more options which can be set app.set_debug(True) # also web.config.debug app.set_template_caching(False) # also web.config.template_caching app.set_flush_cache_on_startup(True) # instance name and description which appears in the front page app.set_ui_instance(
#!/usr/bin/env python from fsphinx import FSphinxClient from simsearch import SimClient from cloudmining import CloudMiningApp # create a FSphinxClient from the configuration file cl = FSphinxClient.FromConfig('config/sphinx_client.py') # create similarity search client sim_cl = SimClient.FromConfig('config/simsearch_client.py') # create a new CloudMining web application app = CloudMiningApp(autoreload=True) # set the fsphinx client of the webapp app.set_fsphinx_client(cl) # same for similarity search app.set_sim_client(sim_cl) # if cl has a search cache preload it app.set_preload_cache_file('data/redis-cache.dat') # some more options which can be set app.set_debug(True) # also web.config.debug app.set_template_caching(False) # also web.config.template_caching app.set_flush_cache_on_startup(True) # what sorting options are shown (key must match cl sort options) app.set_ui_sort_by( dict(key='cit', description='number of citations'),
#!/usr/bin/env python from cloudmining import CloudMiningApp # assumes a default directory structure app = CloudMiningApp.from_directory('.', autoreload=True) # what sorting options are shown (key must match cl sort options) app.set_ui_sort_by(dict(key='pop', description='popularity'), dict(key='dat', description='date'), dict(key='rat', description='user ratings'), dict(key='vot', description='number of votes')) # you can reorder the facets and change default look here # name must match the sphinx client facet names app.set_ui_facets( dict(name='year', color='purple', collapsed=True, visualization='rose'), dict(name='genre', color='green', visualization='counts'), dict(name='keyword', color='black', visualization='counts'), dict(name='director', color='blue', visualization='counts'), dict(name='actor', color='red', visualization='counts'), ) # some more options which can be set app.set_debug(True) # also web.config.debug app.set_template_caching(False) # also web.config.template_caching app.set_flush_cache_on_startup(True) # instance name and description which appears in the front page app.set_ui_instance(instance_name='IMDb', description=''' <p>Search <strong>movies</strong> from <a href="http://www.imdb.com">IMDB</a>.
#!/usr/bin/env python from cloudmining import CloudMiningApp # assumes a default directory structure app = CloudMiningApp.from_directory('.', autoreload=True) # you can reorder the facets and change default look here # name must match the sphinx client facet names app.set_ui_facets( dict(name='author', visualization='counts'), dict(name='journal', color='green', collapsed=True), dict(name='mesh', color='black'), dict(name='year', visualization='rose'), ) # some more options which can be set app.set_debug(True) # also web.config.debug app.set_template_caching(False) # also web.config.template_caching app.set_flush_cache_on_startup(True) # instance name and description which appears in the front page app.set_ui_instance( instance_name='MEDLINE', description='''<p>Search over 18M <strong>biomedical articles</strong> from <a href="http://www.ncbi.nlm.nih.gov/pubmed">MEDLINE</a> enhanced with citations from <a href="http://www.ncbi.nlm.nih.gov/pmc">Pubmed Central</a>.</p>''' ) # custom template functions import lib.templating # custom search function to handle cite queries
#!/usr/bin/env python from cloudmining import CloudMiningApp # assumes a default directory structure app = CloudMiningApp.from_directory( '/home/letterlocked/CloudMining/examples/imdb', autoreload=True) # what sorting options are shown (key must match cl sort options) app.set_ui_sort_by(dict(key='pop', description='popularity'), dict(key='dat', description='date'), dict(key='rat', description='user ratings'), dict(key='vot', description='number of votes')) # you can reorder the facets and change default look here # name must match the sphinx client facet names app.set_ui_facets( dict(name='year', color='purple', collapsed=True, visualization='rose'), dict(name='genre', color='green', visualization='counts'), dict(name='keyword', color='black', visualization='counts'), dict(name='director', color='blue', visualization='counts'), dict(name='actor', color='red', visualization='counts'), ) # some more options which can be set app.set_debug(True) # also web.config.debug app.set_template_caching(False) # also web.config.template_caching app.set_flush_cache_on_startup(True) # instance name and description which appears in the front page app.set_ui_instance(instance_name='IMDb', description='''
#!/usr/bin/env python from fsphinx import FSphinxClient from simsearch import SimClient from cloudmining import CloudMiningApp # create a FSphinxClient from the configuration file cl = FSphinxClient.FromConfig('config/sphinx_client.py') # create similarity search client sim_cl = SimClient.FromConfig('config/simsearch_client.py') # create a new CloudMining web application app = CloudMiningApp(autoreload=True) # set the fsphinx client of the webapp app.set_fsphinx_client(cl) # same for similarity search app.set_sim_client(sim_cl) # if cl has a search cache preload it app.set_preload_cache_file('data/redis-cache.dat') # some more options which can be set app.set_debug(True) # also web.config.debug app.set_template_caching(False) # also web.config.template_caching app.set_flush_cache_on_startup(True) # what sorting options are shown (key must match cl sort options) app.set_ui_sort_by(dict(key='cit', description='number of citations'), dict(key='rel', description='relevance'),
from cloudmining import CloudMiningApp # assumes a default directory structure app = CloudMiningApp.from_directory('.') # launch default web server if __name__ == '__main__': app.run()