コード例 #1
0
 def __init__(self, transmogrifier, name, options, previous):
     self.every = int(options.get("every", 1000))
     self.previous = previous
     self.context = transmogrifier.context
     self.pathkey = defaultMatcher(options, "path-key", name, "path")
     self.poskey = defaultMatcher(options, "pos-key", name, "gopip")
     # Position of items without a position value
     self.default_pos = int(options.get("default-pos", 1000000))
コード例 #2
0
    def __init__(self, transmogrifier, name, options, previous):
        self.previous = previous
        self.context = transmogrifier.context

        self.pathkey = defaultMatcher(options, "path-key", name, "path")
        self.layoutkey = defaultMatcher(options, "layout-key", name, "layout")
        self.defaultpagekey = defaultMatcher(options, "default-page-key", name,
                                             "defaultpage")
コード例 #3
0
    def __init__(self, transmogrifier, name, options, previous):
        self.previous = previous
        self.context = transmogrifier.context
        self.ttool = api.portal.get_tool(name="portal_types")

        self.typekey = defaultMatcher(options, "type-key", name, "type",
                                      ("portal_type", "Type"))
        self.pathkey = defaultMatcher(options, "path-key", name, "path")
        self.required = bool(options.get("required"))
        self.overwrite = options.get("overwrite") in ("true", "True", "1",
                                                      True, 1)
コード例 #4
0
    def __init__(self, transmogrifier, name, options, previous):
        self.transmogrifier = transmogrifier
        self.transmogrifier.fixrelations = []
        self.previous = previous
        self.context = transmogrifier.context
        self.name = name
        self.pathkey = defaultMatcher(options, "path-key", name, "path")
        self.fileskey = options.get("files-key", "_files").strip()
        self.disable_constraints = Expression(
            options.get("disable-constraints", "python: False"),
            transmogrifier,
            name,
            options,
        )

        # create logger
        if options.get("logger"):
            self.logger = logging.getLogger(options["logger"])
            self.loglevel = getattr(logging, options["loglevel"], None)
            if self.loglevel is None:
                # Assume it's an integer:
                self.loglevel = int(options["loglevel"])
            self.logger.setLevel(self.loglevel)
            self.log = lambda s: self.logger.log(self.loglevel, s)
        else:
            self.log = None
        self.errored = IAnnotations(api.portal.get().REQUEST).setdefault(
            ERROREDKEY, [])
コード例 #5
0
    def __init__(self, transmogrifier, name, options, previous):
        # read additional config in cfg file, and apply to default
        self.debug_infos = {}

        self.transmogrifier = transmogrifier
        self.name = name
        self.options = options
        self.previous = previous
        self.context = transmogrifier.context

        if "path-key" in options:
            pathkeys = options["path-key"].splitlines()
        else:
            pathkeys = defaultKeys(options["blueprint"], name, "path")
        self.pathkey = Matcher(*pathkeys)

        self.typekey = defaultMatcher(options, "type-key", name, "type",
                                      ("portal_type", "Type"))

        if options.get("exclude-type", None):
            self.exclude_type = ast.literal_eval(
                options.get("exclude-type", None))

        annotations = IAnnotations(self.context.REQUEST)
        self.items_in = annotations.setdefault(ITEMS_IN, {})
コード例 #6
0
    def __init__(self, transmogrifier, name, options, previous):
        self.previous = previous
        self.context = transmogrifier.context

        self.pathKey = defaultMatcher(options, "path-key", name, "path")

        self.newPathKey = options.get("new-path-key", None)
        self.newTypeKey = options.get("new-type-key", "_type")

        self.folderType = options.get("folder-type", "Folder")
        self.cache = options.get("cache", "true").lower() == "true"

        self.seen = set()
コード例 #7
0
 def __init__(self, transmogrifier, name, options, previous):
     self.previous = previous
     self.context = transmogrifier.context
     self.portal_catalog = transmogrifier.context.portal_catalog
     self.pathkey = defaultMatcher(options, "path-key", name, "path")
     self.verbose = options.get("verbose", "0").lower() in (
         "1",
         "true",
         "yes",
         "on",
     )
     self.counter = 0
     self.indexes = [
         it for it in options.get("indexes", "").splitlines() if it
     ]  # noqa
コード例 #8
0
    def __init__(self, transmogrifier, name, options, previous):
        """
        :param options['path-key']: The key, under the path can be found in
                                    the item.
        :param options['creation-key']: Creation date key. Defaults to
                                        creation_date.
        :param options['modification-key']: Modification date key. Defaults to
                                            modification_date.
        :param options['effective-key']: Effective date key. Defaults to
                                            effective_date.
        :param options['expiration-key']: Expiration date key. Defaults to
                                            expiration_date.
        """
        self.previous = previous
        self.context = transmogrifier.context

        self.pathkey = defaultMatcher(options, "path-key", name, "path")
        self.creationkey = "creation_date"
        self.modificationkey = "modification_date"
        self.effectivekey = "effectiveDate"
        self.expirationkey = "expiration_date"