Ejemplo n.º 1
0
 def __init__(self, pad, data, page_num=None):
     SourceObject.__init__(self, pad)
     self._data = data
     if page_num is not None and not self.supports_pagination:
         raise RuntimeError('%s does not support pagination' %
                            self.__class__.__name__)
     self.page_num = page_num
Ejemplo n.º 2
0
    def __init__(self, pad, name, path=None, parent=None):
        SourceObject.__init__(self, pad)
        if parent is not None:
            if path is None:
                path = name
            path = os.path.join(parent.source_filename, path)
        self.source_filename = path

        self.name = name
        self.parent = parent
Ejemplo n.º 3
0
    def __init__(self, pad, name, path=None, parent=None):
        SourceObject.__init__(self, pad)
        if parent is not None:
            if path is None:
                path = name
            path = os.path.join(parent.source_filename, path)
        self.source_filename = path

        self.name = name
        self.parent = parent
 def get_parents(source_this: SourceObject):
     pad_this = source_this.pad
     record_root = pad_this.get_root(alt=source_this.alt)
     records_parents = []
     record_parent = record_root
     while True:
         records_parents.append(record_parent)
         if source_this.record.path == record_parent.path:
             break
         for record_child in record_parent.children:
             if source_this.is_child_of(record_child):
                 record_parent = record_child
                 break
         else:
             return None
     return records_parents
Ejemplo n.º 5
0
Archivo: db.py Proyecto: jab/lektor
 def __init__(self, pad, data):
     SourceObject.__init__(self, pad)
     self._data = data
     self._fast_source_hash = None
Ejemplo n.º 6
0
Archivo: db.py Proyecto: jab/lektor
 def __init__(self, pad, data):
     SourceObject.__init__(self, pad)
     self._data = data
     self._fast_source_hash = None