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


Python TX.asDir方法代码示例

本文整理汇总了Python中xierpa3.toolbox.transformer.TX.asDir方法的典型用法代码示例。如果您正苦于以下问题:Python TX.asDir方法的具体用法?Python TX.asDir怎么用?Python TX.asDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xierpa3.toolbox.transformer.TX的用法示例。


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

示例1: make

# 需要导入模块: from xierpa3.toolbox.transformer import TX [as 别名]
# 或者: from xierpa3.toolbox.transformer.TX import asDir [as 别名]
 def make(self, root=None):
     u"""The instance of this class builds CSS and HTML files at the optional path *root*.
     If not defined, then @[email protected] is used, as in general builders 
     are associated where output should go to. 
     E.g. the default @[email protected] is defined as to the user extended 
     path of @~/Desktop/Xierpa3Examples/[component.name]@.
     And for @[email protected] it is @~/Desktop/Xierpa3Examples/[component.name]/css/[email protected]"""
     if root is None:
         root = TX.asDir(self.C.PATH_EXAMPLES) # Expand user path to full directory path.
     # C S S
     # Create the main CSS builder instance to build the CSS part of the site.
     cssBuilder = CssBuilder()
     # Compile (=build) the SCSS to CSS.
     self.build(cssBuilder) 
     # Save the file in "css/style.css".
     cssBuilder.save(self, root=root) 
 
     # H T M L
     # Create the main HTML builder instance to build the HTML part of the site.
     htmlBuilder = HtmlBuilder()
     # Compile the site instance and its components into HTML code.
     self.build(htmlBuilder) 
     # Save the resulting HTML file in "helloWorld.html"
     # Answer the file path, so we can directly open the file with a browser.
     return htmlBuilder.save(self, root=root)  
开发者ID:petrvanblokland,项目名称:Xierpa3,代码行数:27,代码来源:make.py

示例2: make

# 需要导入模块: from xierpa3.toolbox.transformer import TX [as 别名]
# 或者: from xierpa3.toolbox.transformer.TX import asDir [as 别名]
 def make(self, root):
     u"""The instance of this class builds CSS and HTML files at the optional path <b>root</b>.
     If not defined, then the default ~/Desktop/Xierpa3Examples/[component.name] is used as export path,
     as set by Builder.DEFAULT_ROOTPATH"""
     # Create an "instance" (=object) of type "HelloWorldLayout". The type (=class) defines
     # the behavior of the object that is made by calling the class.
     if root is None:
         root = TX.asDir(self.C.PATH_EXAMPLES) # Expand user path to full directory path.
     # C S S
     # Create the main CSS builder instance to build the SASS/CSS part of the site.
     cssBuilder = CssBuilder()
     # Compile (=build) the SCSS to CSS and save the file in "css/style.css".
     self.build(cssBuilder) # Build from entire site theme, not just from template. Result is stream in builder.
     cssBuilder.save(self, root) 
 
     # H T M L
     # Create the main HTML builder instance to build the HTML part of the site.
     htmlBuilder = HtmlBuilder()
     # Compile the HTML and save the resulting HTML file in "helloWorld.html".
     self.build(htmlBuilder) # Build from entire site theme, not just from template. Result is stream in builder.
     # Answer the path, so we can directly open the file with a browser.
     return htmlBuilder.save(self, root)  
开发者ID:thongnv,项目名称:Xierpa3,代码行数:24,代码来源:make.py

示例3: getFilePath

# 需要导入模块: from xierpa3.toolbox.transformer import TX [as 别名]
# 或者: from xierpa3.toolbox.transformer.TX import asDir [as 别名]
 def getFilePath(self, component, root=None):
     u"""Answer the file path of @[email protected]"""
     return TX.asDir(root or self.ROOT_PATH) + self.getComponentFileName(root, component)
开发者ID:petrvanblokland,项目名称:Xierpa3,代码行数:5,代码来源:builder.py

示例4: getRootDir

# 需要导入模块: from xierpa3.toolbox.transformer import TX [as 别名]
# 或者: from xierpa3.toolbox.transformer.TX import asDir [as 别名]
 def getRootDir(cls):
     u"""Answer the default root directory path, e.g. to store example files and cached SASS/CSS."""
     return TX.asDir(cls.C.PATH_EXAMPLES + cls.getPythonClassName().lower() + '/') # Expand user path to full directory path.
开发者ID:thongnv,项目名称:Xierpa3,代码行数:5,代码来源:component.py


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