当前位置: 首页>>代码示例>>Python>>正文


Python util.get_pkginfo函数代码示例

本文整理汇总了Python中trac.util.get_pkginfo函数的典型用法代码示例。如果您正苦于以下问题:Python get_pkginfo函数的具体用法?Python get_pkginfo怎么用?Python get_pkginfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_pkginfo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_get_pkginfo_non_toplevel

 def test_get_pkginfo_non_toplevel(self):
     from trac import core
     import tracopt
     pkginfo = util.get_pkginfo(trac)
     self.assertEqual(pkginfo, util.get_pkginfo(util))
     self.assertEqual(pkginfo, util.get_pkginfo(core))
     self.assertEqual(pkginfo, util.get_pkginfo(tracopt))
开发者ID:pkdevbox,项目名称:trac,代码行数:7,代码来源:__init__.py

示例2: test_get_pkginfo_babel

 def test_get_pkginfo_babel(self):
     try:
         import babel
         import babel.core
         dist = pkg_resources.get_distribution('Babel')
     except:
         pass
     else:
         pkginfo = util.get_pkginfo(babel)
         self.assertNotEqual({}, pkginfo)
         self.assertEqual(pkginfo, util.get_pkginfo(babel.core))
开发者ID:pkdevbox,项目名称:trac,代码行数:11,代码来源:__init__.py

示例3: test_get_pkginfo_genshi

 def test_get_pkginfo_genshi(self):
     try:
         import genshi
         import genshi.core
         dist = pkg_resources.get_distribution('Genshi')
     except:
         pass
     else:
         pkginfo = util.get_pkginfo(genshi)
         self.assertNotEqual({}, pkginfo)
         self.assertEqual(pkginfo, util.get_pkginfo(genshi.core))
开发者ID:pkdevbox,项目名称:trac,代码行数:11,代码来源:__init__.py

示例4: test_get_pkginfo_psycopg2

 def test_get_pkginfo_psycopg2(self):
     # python-psycopg2 deb package doesn't provide SOURCES.txt and
     # top_level.txt
     try:
         import psycopg2
         import psycopg2.extensions
         dist = pkg_resources.get_distribution('psycopg2')
     except:
         pass
     else:
         pkginfo = util.get_pkginfo(psycopg2)
         self.assertNotEqual({}, pkginfo)
         self.assertEqual(pkginfo, util.get_pkginfo(psycopg2.extensions))
开发者ID:pkdevbox,项目名称:trac,代码行数:13,代码来源:__init__.py

示例5: test_get_pkginfo_mysqldb

 def test_get_pkginfo_mysqldb(self):
     # MySQLdb's package name is "MySQL-Python"
     try:
         import MySQLdb
         import MySQLdb.cursors
         dist = pkg_resources.get_distribution('MySQL-Python')
         dist.get_metadata('top_level.txt')
     except:
         pass
     else:
         pkginfo = util.get_pkginfo(MySQLdb)
         self.assertNotEqual({}, pkginfo)
         self.assertEqual(pkginfo, util.get_pkginfo(MySQLdb.cursors))
开发者ID:pkdevbox,项目名称:trac,代码行数:13,代码来源:__init__.py

示例6: get_system_info

 def get_system_info(self):
     """Yield a sequence of `(name, version)` tuples describing the name and
     version information of external packages used by a component.
     """
     import gdata
     from trac.util import get_pkginfo
     yield 'Google Data', get_pkginfo(gdata)['version']
开发者ID:smeggingsmegger,项目名称:TracGoogleAppsAuthPlugin,代码行数:7,代码来源:plugin.py

示例7: functionalSuite

def functionalSuite(suite=None):
    if not suite:
        import trac.tests.functional
        suite = trac.tests.functional.functionalSuite()
    suite.addTest(TestWiki())
    suite.addTest(TestWikiAddAttachment())
    suite.addTest(TestWikiPageManipulator())
    suite.addTest(TestWikiHistory())
    suite.addTest(TestWikiRename())
    suite.addTest(RegressionTestTicket4812())
    suite.addTest(RegressionTestTicket10274())
    suite.addTest(RegressionTestTicket10850())
    suite.addTest(RegressionTestTicket10957())
    suite.addTest(RegressionTestTicket11302())
    suite.addTest(RegressionTestTicket11518())
    if has_docutils:
        import docutils
        if get_pkginfo(docutils):
            suite.addTest(ReStructuredTextWikiTest())
            suite.addTest(ReStructuredTextCodeBlockTest())
        else:
            print "SKIP: reST wiki tests (docutils has no setuptools metadata)"
    else:
        print "SKIP: reST wiki tests (no docutils)"
    if ConfigObj:
        suite.addTest(RegressionTestTicket8976())
    else:
        print "SKIP: RegressionTestTicket8976 (ConfigObj not installed)"
    return suite
开发者ID:exocad,项目名称:exotrac,代码行数:29,代码来源:functional.py

示例8: trac_version

    def trac_version(self):
        """Returns the version of Trac.
        :since: 1.2
        """
        from trac import core, __version__

        return get_pkginfo(core).get("version", __version__)
开发者ID:spsoft-RockWang,项目名称:project-_trac,代码行数:7,代码来源:env.py

示例9: __init__

	def __init__(self):
		self._mssql_version = None
		self._mssql_version = has_mssql and \
								get_pkginfo(pymssql).get('version',
														 pymssql.__version__)
		if self._mssql_version:
			self.required = True
			self.error = None
开发者ID:Reposoft,项目名称:trac-mssql.old,代码行数:8,代码来源:mssql_backend.py

示例10: __init__

 def __init__(self):
     version = get_pkginfo(pygments).get('version')
     # if installed from source, fallback to the hardcoded version info
     if not version and hasattr(pygments, '__version__'):
         version = pygments.__version__
     self.env.systeminfo.append(('Pygments',version))
                                     
     self._types = None
开发者ID:gdgkyoto,项目名称:kyoto-gtug,代码行数:8,代码来源:pygments.py

示例11: get_system_info

 def get_system_info(self):
     from trac import core, __version__ as VERSION
     yield 'Trac', get_pkginfo(core).get('version', VERSION)
     yield 'Python', sys.version
     yield 'setuptools', setuptools.__version__
     from trac.util.datefmt import pytz
     if pytz is not None:
         yield 'pytz', pytz.__version__
开发者ID:moreati,项目名称:trac-gitsvn,代码行数:8,代码来源:env.py

示例12: get_system_info

 def get_system_info(self):
     # Move implementation to httpbl, ip_blacklist and url_blacklist
     # when support for Trac < 1.2 is dropped (#12294).
     try:
         import dns
     except ImportError:
         pass
     else:
         yield 'dnspython', get_pkginfo(dns)['version']
开发者ID:Puppet-Finland,项目名称:trac,代码行数:9,代码来源:filtersystem.py

示例13: get_connection

 def get_connection(self, path, log=None, user=None, password=None,
                    host=None, port=None, params={}):
     cnx = PostgreSQLConnection(path, log, user, password, host, port,
                                params)
     if not self._version:
         self._version = get_pkginfo(psycopg).get('version',
                                                  psycopg.__version__)
         self.env.systeminfo.append(('psycopg2', self._version))
         self.required = True
     return cnx
开发者ID:exocad,项目名称:exotrac,代码行数:10,代码来源:postgres_backend.py

示例14: __init__

 def __init__(self):
     self.log.debug("SilverCity installed? %r", have_silvercity)
     if have_silvercity:
         self.env.systeminfo.append(('SilverCity',
                                     get_pkginfo(SilverCity).get('version',
                                                                 '?')))
         # TODO: the above works only if setuptools was used to build
         # SilverCity, which is not yet the case by default for 0.9.7.
         # I've not been able to find an alternative way to get version.
     self._types = None
开发者ID:gdgkyoto,项目名称:kyoto-gtug,代码行数:10,代码来源:silvercity.py

示例15: get_connection

 def get_connection(self, path, log=None, user=None, password=None,
                    host=None, port=None, params={}):
     cnx = PostgreSQLConnection(path, log, user, password, host, port,
                                params)
     if not self._version:
         if has_psycopg:
             self._version = get_pkginfo(psycopg).get('version',
                                                      psycopg.__version__)
             name = 'psycopg2'
         elif has_pgsql:
             import pyPgSQL
             self._version = get_pkginfo(pyPgSQL).get('version',
                                                      pyPgSQL.__version__)
             name = 'pyPgSQL'
         else:
             name = 'unknown postgreSQL driver'
             self._version = '?'
         self.env.systeminfo.append((name, self._version))
     return cnx
开发者ID:gdgkyoto,项目名称:kyoto-gtug,代码行数:19,代码来源:postgres_backend.py


注:本文中的trac.util.get_pkginfo函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。