Beispiel #1
0
def testbae(request):
    import os
    import django
    import sys
    import whoosh
    import jieba
    import tempfile

    cwdpath = os.path.abspath(os.getcwd())
    django_version = django.get_version()
    python_version = sys.version
    platform = sys.platform
    return render_to_response('test.html',
                              {
                                  'module_index': -1,
                                  'page_title': "bae环境参数",
                                  'cwdpath': cwdpath,
                                  'django_version': django_version,
                                  'python_version': python_version,
                                  'platform': platform,
                                  'whoosh_version': whoosh.versionstring(),
                                  'jieba_is_working': bool(jieba.cut('test')),
                                  'sys_temp_dir': tempfile.gettempdir(),
                              },
                              context_instance=RequestContext(request))
def printSoftwareInfo():
    import whoosh, psutil, matplotlib
    whoosh_version = whoosh.versionstring()
    psutil_version = psutil.__version__
    matplotlib_version = matplotlib.__version__
    python_version = platform.python_version()
    print "Software Tools used:\n ",
    print "Whoosh %s, psutil %s, matplotlib %s, python %s" % (whoosh_version,
                                                              psutil_version,
                                                              matplotlib_version,
                                                              python_version)
Beispiel #3
0
def about(request):
    import translate.__version__
    import whoosh
    import django
    import git
    return render_to_response('about.html', RequestContext(request, {
        'title': _('About Weblate'),
        'tt_version': translate.__version__.sver,
        'whoosh_version': whoosh.versionstring(),
        'django_version': django.get_version(),
        'git_version': git.__version__,
    }))
Beispiel #4
0
def get_version_info(module):
    """Returns the version information for the target core module
    :return: string
    """
    module = module.lower()
    if module == 'cherrypy':
        import cherrypy
        return cherrypy.__version__
    elif module == 'whoosh':
        return whoosh.versionstring()
    elif module == 'pygments':
        return pygments.__version__
    elif module == 'flask':
        return flask.__version__
    elif module == 'sherlock':
        import sherlock
        return sherlock.__version__
    return '0.0'
Beispiel #5
0
def get_version_info(module):
    """Returns the version information for the target core module
    :return: string
    """
    module = module.lower()
    if module == 'cherrypy':
        import cherrypy
        return cherrypy.__version__
    elif module == 'whoosh':
        return whoosh.versionstring()
    elif module == 'pygments':
        return pygments.__version__
    elif module == 'flask':
        return flask.__version__
    elif module == 'sherlock':
        import sherlock
        return sherlock.__version__
    return '0.0'
Beispiel #6
0
    def get_status_of_module(module, prefix=None, version=True):
        modules = list(sys.modules.keys())
        is_enabled = module in modules
        if is_enabled:
            if module == 'pyme':
                from pyme import version
                version = "version %s" % version.versionstr
            elif module == 'MySQLdb':
                from MySQLdb import version_info
                version = "version %s" % ".".join(
                    [str(v) for v in version_info])
            elif module == 'pychart':
                from pychart import version
                version = "version %s" % version.version
            elif module == 'sqlite3':
                from sqlite3 import version
                version = "version %s" % version
            elif module == "whoosh":
                from whoosh import versionstring
                version = "version %s" % versionstring()
            elif module == 'xapian':
                from xapian import version_string
                version = "version %s" % version_string()
            else:
                if version:
                    m = __import__(module)
                    try:
                        version = "version %s" % m.__version__
                    except AttributeError:
                        version = "version unavailable - exception thrown"
                else:
                    version = "version unavailable"

            if prefix:
                return "%s %s %s enabled: %s" % (prefix, module, version,
                                                 is_enabled)
            else:
                return "Module: %s %s enabled: %s" % (module, version,
                                                      is_enabled)
        else:
            if prefix:
                return "%s %s enabled: %s" % (prefix, module, is_enabled)
            else:
                return "Module: %s enabled: %s" % (module, is_enabled)
Beispiel #7
0
class PyTest(TestCommand):
    def finalize_options(self):
        TestCommand.finalize_options(self)
        self.test_args = []
        self.test_suite = True

    def run_tests(self):
        #import here, cause outside the eggs aren't loaded
        import pytest
        pytest.main(self.test_args)


if __name__ == "__main__":
    setup(
        name="Whoosh",
        version=versionstring(),
        package_dir={'': 'src'},
        packages=find_packages("src"),
        author="Matt Chaput",
        author_email="*****@*****.**",
        description=
        "Fast, pure-Python full text indexing, search, and spell checking library.",
        long_description=open("README.txt").read(),
        license="Two-clause BSD license",
        keywords="index search text spell",
        url="http://bitbucket.org/mchaput/whoosh",
        zip_safe=True,
        tests_require=['pytest'],
        cmdclass={'test': PyTest},
        classifiers=[
            "Development Status :: 5 - Production/Stable",
Beispiel #8
0
class PyTest(TestCommand):
    def finalize_options(self):
        TestCommand.finalize_options(self)
        self.test_args = []
        self.test_suite = True

    def run_tests(self):
        #import here, cause outside the eggs aren't loaded
        import pytest
        pytest.main(self.test_args)


if __name__ == "__main__":
    setup(
        name="Whoosh",
        version=versionstring(),
        package_dir={'': 'src'},
        packages=find_packages("src"),

        author="Matt Chaput",
        author_email="*****@*****.**",

        description="Fast, pure-Python full text indexing, search, and spell checking library.",
        long_description=open("README.txt").read(),

        license="Two-clause BSD license",
        keywords="index search text spell",
        url="http://bitbucket.org/mchaput/whoosh",

        zip_safe=True,
        tests_require=['pytest'],
Beispiel #9
0
 def get_system_info(self):
     yield 'Whoosh', whoosh.versionstring()
Beispiel #10
0
# The encoding of source files.
#source_encoding = 'utf-8'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'Whoosh'
copyright = u'2007-2012 Matt Chaput'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = whoosh.versionstring(build=False)
# The full version, including alpha/beta/rc tags.
release = whoosh.versionstring()

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'

# List of documents that shouldn't be included in the build.
#unused_docs = []
Beispiel #11
0
# The encoding of source files.
#source_encoding = 'utf-8'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'Whoosh'
copyright = u'2007, Matt Chaput'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = whoosh.versionstring(build=False)
# The full version, including alpha/beta/rc tags.
release = whoosh.versionstring()

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'

# List of documents that shouldn't be included in the build.
#unused_docs = []
Beispiel #12
0
 def get_system_info(self):
     yield 'Whoosh', whoosh.versionstring()