def __init__(self, name, _prefix=None, **kw):
        " doc string "
        
        description = kw.get('description',kw.get('d',''))
        
        # 'optimize' argument
        optimize = kw.get('optimize', kw.get('opt', None))
        self.optimize = acceptableSyntax(optimize)
            
        if not kw.has_key('uncheckoutable'):
            sep = name[max(name.find('\\'), name.find('/'))]
            self.ctnamesplit = name.split(sep)

            prodpath = _prefix['__name__'].split('.')[:-1]
            prodpath = ".".join(prodpath).replace('.',os.sep)

            basepath = os.path.join(CT_INSTANCE_HOME, prodpath)
            if not os.path.isdir(basepath):
                basepath = os.path.join(CT_SOFTWARE_HOME, prodpath)
            
            # first, open file to see how old it is.
            name = name.replace('/', os.sep).replace('\\',os.sep)
            
            t = os.stat(os.path.join(basepath, name+ '.dtml'))
            mtime = t[stat.ST_MTIME]
            
            # if already there there's no point to
            # add it again
            added = write2config(basepath, name, description,
                                 mtime, 'DTML')

            if DEBUG and added:
                LOG(self.__class__.__name__, INFO, name)

        apply(DTMLFile.__init__, (self, name, _prefix), kw)
Beispiel #2
0
    def __init__(self, name, _prefix=None, **kw):
        """ doc string """

        description = kw.get("description", kw.get("d", ""))

        # 'optimize' argument
        optimize = kw.get("optimize", kw.get("opt", None))
        self.optimize = acceptableSyntax(optimize)

        if not kw.has_key("uncheckoutable"):
            sep = name[max(name.find("\\"), name.find("/"))]
            self.ctnamesplit = name.split(sep)

            prodpath = _prefix["__name__"].split(".")[:-1]
            prodpath = ".".join(prodpath).replace(".", os.sep)

            basepath = os.path.join(CT_INSTANCE_HOME, prodpath)
            if not os.path.isdir(basepath):
                if os.path.isdir(os.path.join(CT_SOFTWARE_HOME, prodpath)):
                    basepath = os.path.join(CT_SOFTWARE_HOME, prodpath)
                elif os.path.isdir(os.path.join(CT_INSTANCE_HOME, "Products", prodpath)):
                    basepath = os.path.join(CT_INSTANCE_HOME, "Products", prodpath)

            # first, open file to see how long it is.
            name = name.replace("/", os.sep).replace("\\", os.sep)

            template_path = os.path.join(basepath, name)
            if not os.path.splitext(template_path)[1]:
                template_path += ".zpt"

            t = os.stat(template_path)
            mtime = t[stat.ST_MTIME]

            added = write2config(basepath, name, description, mtime, "ZPT")

            if DEBUG and added:
                LOG(self.__class__.__name__, INFO, name)

        apply(PageTemplateFile.__init__, (self, name, _prefix), kw)
    def __init__(self, name, _prefix=None, **kw):
        """ doc string """
        
        description = kw.get('description',kw.get('d',''))

        # 'optimize' argument
        optimize = kw.get('optimize', kw.get('opt', None))
        self.optimize = acceptableSyntax(optimize)
        
        if not kw.has_key('uncheckoutable'):
            sep = name[max(name.find('\\'), name.find('/'))]
            self.ctnamesplit = name.split(sep)
            
            prodpath = _prefix['__name__'].split('.')[:-1]
            prodpath = ".".join(prodpath).replace('.',os.sep)
            
            basepath = os.path.join(CT_INSTANCE_HOME, prodpath)
            if not os.path.isdir(basepath):
                basepath = os.path.join(CT_SOFTWARE_HOME, prodpath)
            
            # first, open file to see how long it is.
            name = name.replace('/', os.sep).replace('\\',os.sep)

            template_path = os.path.join(basepath, name)
            if not os.path.splitext(template_path)[1]:
                template_path += '.zpt'
            
            t = os.stat(template_path)
            mtime = t[stat.ST_MTIME]
            
            added = write2config(basepath, name, description,
                                 mtime, 'ZPT')
            
            if DEBUG and added:
                LOG(self.__class__.__name__, INFO, name)
            
        apply(PageTemplateFile.__init__, (self, name, _prefix), kw)
Beispiel #4
0
    def __init__(self, name, _prefix=None, **kw):
        " doc string "

        description = kw.get("description", kw.get("d", ""))

        # 'optimize' argument
        optimize = kw.get("optimize", kw.get("opt", None))
        self.optimize = acceptableSyntax(optimize)

        if not kw.has_key("uncheckoutable"):
            sep = name[max(name.find("\\"), name.find("/"))]
            self.ctnamesplit = name.split(sep)

            prodpath = _prefix["__name__"].split(".")[:-1]
            prodpath = ".".join(prodpath).replace(".", os.sep)

            basepath = os.path.join(CT_INSTANCE_HOME, prodpath)
            if not os.path.isdir(basepath):
                if os.path.isdir(os.path.join(CT_SOFTWARE_HOME, prodpath)):
                    basepath = os.path.join(CT_SOFTWARE_HOME, prodpath)
                elif os.path.isdir(os.path.join(CT_INSTANCE_HOME, "Products", prodpath)):
                    basepath = os.path.join(CT_INSTANCE_HOME, "Products", prodpath)

            # first, open file to see how old it is.
            name = name.replace("/", os.sep).replace("\\", os.sep)

            t = os.stat(os.path.join(basepath, name + ".dtml"))
            mtime = t[stat.ST_MTIME]

            # if already there there's no point to
            # add it again
            added = write2config(basepath, name, description, mtime, "DTML")

            if DEBUG and added:
                LOG(self.__class__.__name__, INFO, name)

        apply(DTMLFile.__init__, (self, name, _prefix), kw)