[py-svn] r7193 - in py/dist/py/path: . extpy local test
arigo at codespeak.net
arigo at codespeak.net
Mon Nov 8 18:21:24 CET 2004
Author: arigo
Date: Mon Nov 8 18:21:23 2004
New Revision: 7193
Modified:
py/dist/py/path/common.py
py/dist/py/path/extpy/extpy.py
py/dist/py/path/local/local.py
py/dist/py/path/test/fscommon.py
Log:
Renamed getmodule() and getcodeobj() to getpymodule() and getpycodeobj().
Modified: py/dist/py/path/common.py
==============================================================================
--- py/dist/py/path/common.py (original)
+++ py/dist/py/path/common.py Mon Nov 8 18:21:23 2004
@@ -283,14 +283,14 @@
self.copy(target)
self.remove()
- def getmodule(self):
+ def getpymodule(self):
"""resolve this path to a module python object. """
modname = str(self)
modname = modname.replace('.', self.sep)
try:
return sys.modules[modname]
except KeyError:
- co = self.getcodeobj()
+ co = self.getpycodeobj()
mod = py.std.new.module(modname)
mod.__file__ = str(self)
#mod.__path__ = [str(self.get('dirname'))]
@@ -298,7 +298,7 @@
exec co in mod.__dict__
return mod
- def getcodeobj(self):
+ def getpycodeobj(self):
s = self.read()
# XXX str(self) should show up somewhere in the code's filename
return py.magic.dyncode.compile2(s)
Modified: py/dist/py/path/extpy/extpy.py
==============================================================================
--- py/dist/py/path/extpy/extpy.py (original)
+++ py/dist/py/path/extpy/extpy.py Mon Nov 8 18:21:23 2004
@@ -84,7 +84,7 @@
the root along the modpath.
"""
rest = filter(None, self.modpath.split('.'))
- target = self.getmodule()
+ target = self.getpymodule()
for name in rest:
try:
target = getattr(target, name)
@@ -92,11 +92,11 @@
raise py.path.NotFound("%r in %s" %(self.modpath, self))
return target
- def getmodule(self):
+ def getpymodule(self):
if hasattr(self.root, 'resolve'):
return self.root.resolve()
else:
- return self.root.getmodule()
+ return self.root.getpymodule()
def relto(self, otherpath):
if self.root == otherpath.root:
Modified: py/dist/py/path/local/local.py
==============================================================================
--- py/dist/py/path/local/local.py (original)
+++ py/dist/py/path/local/local.py Mon Nov 8 18:21:23 2004
@@ -342,7 +342,7 @@
""" return string representation of the Path. """
return self.strpath
- def getcodeobj(self):
+ def getpycodeobj(self):
dotpy = self.check(ext='.py')
if dotpy:
my_magic = py.std.imp.get_magic()
Modified: py/dist/py/path/test/fscommon.py
==============================================================================
--- py/dist/py/path/test/fscommon.py (original)
+++ py/dist/py/path/test/fscommon.py Mon Nov 8 18:21:23 2004
@@ -184,8 +184,8 @@
assert dest.join('moved', 'somefile').read() == '42'
assert not source.check()
- def test_getmodule(self):
- obj = self.root.join('execfile').getmodule()
+ def test_getpymodule(self):
+ obj = self.root.join('execfile').getpymodule()
assert obj.x == 42
def test_not_has_resolve(self):
More information about the pytest-commit
mailing list