本文整理汇总了Python中trac.util.get_pkginfo函数的典型用法代码示例。如果您正苦于以下问题:Python get_pkginfo函数的具体用法?Python get_pkginfo怎么用?Python get_pkginfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_pkginfo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: get_connection
def get_connection(self, path, log=None, params={}):
if not self._version:
self._version = get_pkginfo(sqlite).get(
'version', '%d.%d.%s' % sqlite.version_info)
self.env.systeminfo.extend([('SQLite', sqlite_version_string),
('pysqlite', self._version)])
if have_pysqlite == 1:
self.log.warning("Support for SQLite v2 and PySqlite 1.0.x "
"will be dropped in version 0.12, see "
"http://trac.edgewall.org/wiki/"
"PySqlite#UpgradingSQLitefrom2.xto3.x")
return SQLiteConnection(path, log, params)
开发者ID:gdgkyoto,项目名称:kyoto-gtug,代码行数:12,代码来源:sqlite_backend.py
示例17: get_connection
def get_connection(self, path, log=None, user=None, password=None, host=None, port=None, params={}):
cnx = MySQLConnection(path, log, user, password, host, port, params)
if not self._version:
self._version = get_pkginfo(MySQLdb).get("version", MySQLdb.__version__)
mysql_info = 'server: "%s", client: "%s", thread-safe: %s' % (
cnx.cnx.get_server_info(),
MySQLdb.get_client_info(),
MySQLdb.thread_safe(),
)
self.env.systeminfo.extend([("MySQL", mysql_info), ("MySQLdb", self._version)])
self.required = True
return cnx
开发者ID:dinhkhanh,项目名称:trac,代码行数:12,代码来源:mysql_backend.py
示例18: get_connection
def get_connection(self, path, log=None, params={}):
if not self._version:
self._version = get_pkginfo(sqlite).get(
'version', '%d.%d.%s' % sqlite.version_info)
self.env.systeminfo.extend([('SQLite', sqlite_version_string),
('pysqlite', self._version)])
self.required = True
# construct list of sqlite extension libraries
if self._extensions is None:
self._extensions = []
for extpath in self.extensions:
if not os.path.isabs(extpath):
extpath = os.path.join(self.env.path, extpath)
self._extensions.append(extpath)
params['extensions'] = self._extensions
return SQLiteConnection(path, log, params)
开发者ID:zjj,项目名称:trac_hack,代码行数:16,代码来源:sqlite_backend.py
示例19: functionalSuite
def functionalSuite(suite=None):
if not suite:
import trac.tests.functional.testcases
suite = trac.tests.functional.testcases.functionalSuite()
suite.addTest(TestWiki())
suite.addTest(RegressionTestTicket4812())
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)"
return suite
开发者ID:gdgkyoto,项目名称:kyoto-gtug,代码行数:16,代码来源:functional.py
示例20: setup_log
def setup_log(self):
"""Initialize the logging sub-system."""
from trac.log import logger_handler_factory
logtype = self.log_type
logfile = self.log_file
if logtype == 'file' and not os.path.isabs(logfile):
logfile = os.path.join(self.get_log_dir(), logfile)
format = self.log_format
if format:
format = format.replace('$(', '%(') \
.replace('%(path)s', self.path) \
.replace('%(basename)s', os.path.basename(self.path)) \
.replace('%(project)s', self.project_name)
self.log, self._log_handler = logger_handler_factory(
logtype, logfile, self.log_level, self.path, format=format)
from trac import core, __version__ as VERSION
self.log.info('-' * 32 + ' environment startup [Trac %s] ' + '-' * 32,
get_pkginfo(core).get('version', VERSION))
开发者ID:moreati,项目名称:trac-gitsvn,代码行数:18,代码来源:env.py
注:本文中的trac.util.get_pkginfo函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论