Esempio n. 1
0
 def generate( self ):
     """:meth:`pluggdapps.interfaces.IScaffold.generate` interface
     method."""
     _vars = { 'webapp_name' : self['webapp_name'] }
     target_dir = abspath( join( self['target_dir'], self['webapp_name'] ))
     os.makedirs( target_dir )
     h.template_to_source( self['template_dir'], target_dir, _vars,
                           overwrite=True, verbose=True )
Esempio n. 2
0
    def create(self, **kwargs) :
        """Creates a new layout under ``sitepath``. Uses the directory tree
        under `pagd:layouts/myblog` as a template for the new layout. Accepts
        the following variable while creating,

        ``sitepath``,
            directory-path under which the new layout had to be created.
        """
        if not isdir( self['sitepath'] ) :
            os.makedirs( self['sitepath'], exist_ok=True )
        _vars = { 'sitepath' : self.sitepath, }
        overwrite = kwargs.get('overwrite', False)
        h.template_to_source( self.layoutpath, self.sitepath, _vars,
                              overwrite=overwrite, verbose=True )