dottednamesolver和其他从pyramid.path中提取的内容
dotted_name_resolver的Python项目详细描述
python_dotted_name_解析器
DottedNameResolver 还有其他的东西 pyramid.path 从美妙的 Pyramid网页 框架。
几个使用
的快速示例In[1]:fromdotted_name_resolverimportDottedNameResolverIn[2]:r=DottedNameResolver()In[3]:r.resolve('os.path')Out[3]:<module'posixpath'from'/Users/marca/python/virtualenvs/dotted_name_resolver/lib/python2.7/posixpath.pyc'>In[4]:r.resolve('os.path.exists')Out[4]:<functiongenericpath.exists>In[5]:r.resolve('dotted_name_resolver.DottedNameResolver.maybe_resolve')Out[5]:<unboundmethodDottedNameResolver.maybe_resolve>In[6]:importos.pathIn[7]:r.resolve(os.path.exists)---------------------------------------------------------------------------ValueErrorTraceback(mostrecentcalllast)<ipython-input-9-0fd311498cae>in<module>()---->1r.resolve(os.path.exists)/Users/marca/dev/git-repos/python_dotted_name_resolver/dotted_name_resolver/__init__.pycinresolve(self,dotted)328ifnotisinstance(dotted,string_types):-->329raiseValueError('%r is not a string'%(dotted,))330package=self.package331ifpackageisCALLER_PACKAGE:ValueError:<functionexistsat0x1002a5398>isnotastringIn[8]:r.maybe_resolve(os.path.exists)Out[8]:<functiongenericpath.exists>In[24]:fromdotted_name_resolverimportAssetResolverIn[25]:a=AssetResolver('IPython')In[26]:a.resolve('html/static/notebook/js/notebook.js').abspath()Out[26]:'/Users/marca/python/virtualenvs/dotted_name_resolver/lib/python2.7/site-packages/IPython/html/static/notebook/js/notebook.js'
文件
有关详细文档,请参见the documentation for pyramid.path和 用dotted_name_resolver替换任何表示pyramid.path的内容。
支持的python版本
$ /Library/Frameworks/Python.framework/Versions/3.3/bin/tox ... py26: commands succeeded py27: commands succeeded py33: commands succeeded py34: commands succeeded pypy: commands succeeded congratulations :)
0.1
- 修复zope.interface安装问题 (https://github.com/msabramo/python_dotted_name_resolver/pull/1)。谢谢, 林维克多!
0.0
- 初始版本