本文整理汇总了Python中exe.engine.path.TempDirPath.isdir方法的典型用法代码示例。如果您正苦于以下问题:Python TempDirPath.isdir方法的具体用法?Python TempDirPath.isdir怎么用?Python TempDirPath.isdir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exe.engine.path.TempDirPath
的用法示例。
在下文中一共展示了TempDirPath.isdir方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testExport
# 需要导入模块: from exe.engine.path import TempDirPath [as 别名]
# 或者: from exe.engine.path.TempDirPath import isdir [as 别名]
def testExport(self):
# Delete the output dir
outdir = TempDirPath()
G.application = Application()
G.application.loadConfiguration()
G.application.preLaunch()
# Load a package
package = Package.load('testing/testPackage2.elp')
# Do the export
style_dir = G.application.config.stylesDir / package.style
exporter = WebsiteExport(G.application.config,
style_dir,
outdir)
exporter.export(package)
# Check that it all exists now
assert outdir.isdir()
assert (outdir / 'index.html').isfile()
# Check that the style sheets have been copied
for filename in style_dir.files():
assert ((outdir / filename.basename()).exists(),
'Style file "%s" not copied' % (outdir / filename.basename()))
# Check that each node in the package has had a page made
pagenodes = Set([p.node for p in exporter.pages])
othernodes = Set(self._getNodes([], package.root))
assert pagenodes == othernodes
for page in exporter.pages:
self._testPage(page, outdir)
示例2: testExport
# 需要导入模块: from exe.engine.path import TempDirPath [as 别名]
# 或者: from exe.engine.path.TempDirPath import isdir [as 别名]
def testExport(self):
outdir = TempDirPath()
package = Package.load('testPackage.elp')
exporter = WebsiteExport('../exe/webui/style/default',
outdir,
'../exe/webui/images',
'../exe/webui/scripts',
'../exe/webui/templates')
exporter.export(package)
assert outdir.isdir()
assert (outdir / 'index.html').isfile()
for filename in Path('../exe/webui/style/default').files():
assert ((outdir / filename.basename()).exists(),
'Style file "%s" not copied' % (outdir / filename.basename()))
pagenodes = Set([p.node for p in exporter.pages])
othernodes = Set(self._getNodes([], package.root))
assert pagenodes == othernodes
for page in exporter.pages:
self._testPage(page, outdir)
示例3: testExport
# 需要导入模块: from exe.engine.path import TempDirPath [as 别名]
# 或者: from exe.engine.path.TempDirPath import isdir [as 别名]
def testExport(self):
# Delete the output dir
outdir = TempDirPath()
G.application = Application()
G.application.loadConfiguration()
G.application.preLaunch()
# Load a package
package = Package.load('testing/testPackage2.elp')
# Do the export
style_dir = G.application.config.stylesDir / package.style
exporter = WebsiteExport(G.application.config,
style_dir,
outdir)
exporter.export(package)
# Check that it all exists now
assert outdir.isdir()
assert (outdir / 'index.html').isfile()
# Check that the style sheets have been copied
for filename in style_dir.files():
#Skip the styles config.xml - that should not be included
if filename.basename() == "config.xml":
continue
assert ((outdir / filename.basename()).exists(),
'Style file "%s" not copied' % (outdir / filename.basename()))
#check the modification time is correct
f_dst = Path(outdir/filename.basename())
f_src = Path(filename)
self.assertTrue(
TestUtils.mod_time_diff(f_dst, f_src) < 0.1,
"Modification time in style dir preserved")
for res_file in package.resourceDir.files():
dst_file = Path(outdir/ res_file.basename())
self.assertTrue(dst_file.isfile())
self.assertTrue(
TestUtils.mod_time_diff(res_file, dst_file) < 0.1,
"Resource file %s has same mod time as origin" \
% res_file.basename())
#test that everything that was copied hahs the right mod time
copy_list = package.make_system_copy_list(style_dir,
G.application.config.webDir/"scripts" ,
G.application.config.webDir/"templates",
G.application.config.webDir/"images",
G.application.config.webDir/"css",
outdir)
TestUtils.check_copy_list_mod_time(copy_list, self)
# Check that each node in the package has had a page made
pagenodes = Set([p.node for p in exporter.pages])
othernodes = Set(self._getNodes([], package.root))
assert pagenodes == othernodes
for page in exporter.pages:
self._testPage(page, outdir)