Exemple #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
Exemple #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
Exemple #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
Exemple #5
0
Fichier : db.py Projet : jab/lektor
 def __init__(self, pad, data):
     SourceObject.__init__(self, pad)
     self._data = data
     self._fast_source_hash = None
Exemple #6
0
Fichier : db.py Projet : jab/lektor
 def __init__(self, pad, data):
     SourceObject.__init__(self, pad)
     self._data = data
     self._fast_source_hash = None