コード例 #1
0
ファイル: server.py プロジェクト: davidsansome/babbledrive
 def changes(self, request, tag):
     item = tag.patternGenerator('item')
     for d in reversed(self.root._edits):
         tag[util.fillSlots(item,
                            diff=self.diff(d),
                            hist=self.hist(d),
                            object=util.taglink(d.obj),
                            time=d.time,
                            user=d.user)]
     return tag
コード例 #2
0
 def changes(self, request, tag):
     item = tag.patternGenerator('item')
     for d in reversed(self.root._edits):
         tag[util.fillSlots(item,
                            diff=self.diff(d),
                            hist=self.hist(d),
                            object=util.taglink(d.obj),
                            time=d.time,
                            user=d.user)]
     return tag
コード例 #3
0
ファイル: __init__.py プロジェクト: davidsansome/babbledrive
 def baseTables(self, item):
     baselists = self.baselists[:]
     if not baselists:
         return []
     if baselists[0][0][0] == self.ob:
         del baselists[0]
     return [fillSlots(item,
                       baseName=self.baseName(b),
                       baseTable=ChildTable(self.docgetter, self.ob, self.has_lineno_col(),
                                               sorted(attrs, key=lambda o:-o.privacyClass)))
             for b, attrs in baselists]
コード例 #4
0
    def index(self, request, tag):
        letter = tag.patternGenerator('letter')
        singleName = tag.patternGenerator('singleName')
        manyNames = tag.patternGenerator('manyNames')
        initials = {}
        for ob in self.system.orderedallobjects:
            if ob.isVisible:
                initials.setdefault(ob.name[0].upper(), []).append(ob)
        for initial in sorted(initials):
            letterlinks = []
            for initial2 in sorted(initials):
                if initial == initial2:
                    letterlinks.append(initial2)
                else:
                    letterlinks.append(tags.a(href='#' + initial2)[initial2])
                letterlinks.append(' - ')
            if letterlinks:
                del letterlinks[-1]
            name2obs = {}
            for obj in initials[initial]:
                name2obs.setdefault(obj.name, []).append(obj)
            lettercontents = []
            for name in sorted(name2obs, key=lambda x: x.lower()):
                obs = sorted(name2obs[name],
                             key=lambda x: x.fullName().lower())
                if len(obs) == 1:
                    ob, = obs
                    lettercontents.append(
                        fillSlots(singleName, name=ob.name, link=taglink(ob)))
                else:
                    lettercontents.append(
                        fillSlots(
                            manyNames,
                            name=obs[0].name,
                            manyNames=[tags.li[taglink(ob)] for ob in obs]))

            tag[fillSlots(letter,
                          letter=initial,
                          letterlinks=letterlinks,
                          lettercontents=lettercontents)]
        return tag
コード例 #5
0
ファイル: summary.py プロジェクト: davidsansome/babbledrive
    def index(self, request, tag):
        letter = tag.patternGenerator('letter')
        singleName = tag.patternGenerator('singleName')
        manyNames = tag.patternGenerator('manyNames')
        initials = {}
        for ob in self.system.orderedallobjects:
            if ob.isVisible:
                initials.setdefault(ob.name[0].upper(), []).append(ob)
        for initial in sorted(initials):
            letterlinks = []
            for initial2 in sorted(initials):
                if initial == initial2:
                    letterlinks.append(initial2)
                else:
                    letterlinks.append(tags.a(href='#'+initial2)[initial2])
                letterlinks.append(' - ')
            if letterlinks:
                del letterlinks[-1]
            name2obs = {}
            for obj in initials[initial]:
                name2obs.setdefault(obj.name, []).append(obj)
            lettercontents = []
            for name in sorted(name2obs, key=lambda x:x.lower()):
                obs = sorted(name2obs[name], key=lambda x:x.fullName().lower())
                if len(obs) == 1:
                    ob, = obs
                    lettercontents.append(fillSlots(singleName,
                                                    name=ob.name,
                                                    link=taglink(ob)))
                else:
                    lettercontents.append(fillSlots(manyNames,
                                                    name=obs[0].name,
                                                    manyNames=[tags.li[taglink(ob)] for ob in obs]))

            tag[fillSlots(letter,
                          letter=initial,
                          letterlinks=letterlinks,
                          lettercontents=lettercontents)]
        return tag
コード例 #6
0
ファイル: __init__.py プロジェクト: mkohler/babbledrive
 def baseTables(self, item):
     baselists = self.baselists[:]
     if not baselists:
         return []
     if baselists[0][0][0] == self.ob:
         del baselists[0]
     return [
         fillSlots(item,
                   baseName=self.baseName(b),
                   baseTable=ChildTable(
                       self.docgetter, self.ob, self.has_lineno_col(),
                       sorted(attrs, key=lambda o: -o.privacyClass)))
         for b, attrs in baselists
     ]
コード例 #7
0
ファイル: __init__.py プロジェクト: davidsansome/babbledrive
 def all(self, request, tag):
     return fillSlots(tag,
                      title=self.title(),
                      ifusesorttable=self.ifusesorttable(tag.onePattern('ifusesorttable')),
                      pydoctorjs=self.pydoctorjs(tag.onePattern('pydoctorjs')),
                      heading=self.heading(),
                      part=self.part(),
                      source=self.source(tag.onePattern('source')),
                      inhierarchy=self.inhierarchy(tag.onePattern('inhierarchy')),
                      extras=self.extras(),
                      docstring=self.docstring(),
                      splittingLinks=self.ifhasplitlinks(tag.onePattern('splittingLinks')),
                      mainTable=self.mainTable(),
                      baseTables=self.baseTables(tag.patternGenerator('baseTable')),
                      bigTable=self.bigTable(tag.patternGenerator('bigTable')),
                      packageInitTable=self.packageInitTable(),
                      childlist=self.childlist(),
                      project=self.project(),
                      buildtime=self.ob.system.buildtime.strftime("%Y-%m-%d %H:%M:%S"),
                      )
コード例 #8
0
ファイル: __init__.py プロジェクト: mkohler/babbledrive
 def all(self, request, tag):
     return fillSlots(
         tag,
         title=self.title(),
         ifusesorttable=self.ifusesorttable(
             tag.onePattern('ifusesorttable')),
         pydoctorjs=self.pydoctorjs(tag.onePattern('pydoctorjs')),
         heading=self.heading(),
         part=self.part(),
         source=self.source(tag.onePattern('source')),
         inhierarchy=self.inhierarchy(tag.onePattern('inhierarchy')),
         extras=self.extras(),
         docstring=self.docstring(),
         splittingLinks=self.ifhasplitlinks(
             tag.onePattern('splittingLinks')),
         mainTable=self.mainTable(),
         baseTables=self.baseTables(tag.patternGenerator('baseTable')),
         bigTable=self.bigTable(tag.patternGenerator('bigTable')),
         packageInitTable=self.packageInitTable(),
         childlist=self.childlist(),
         project=self.project(),
         buildtime=self.ob.system.buildtime.strftime("%Y-%m-%d %H:%M:%S"),
     )
コード例 #9
0
 def roots(self, request, tag):
     item = tag.patternGenerator("item")
     r = []
     for o in self.system.rootobjects:
         r.append(fillSlots(item, root=taglink(o)))
     return tag[r]
コード例 #10
0
ファイル: summary.py プロジェクト: davidsansome/babbledrive
 def roots(self, request, tag):
     item = tag.patternGenerator("item")
     r = []
     for o in self.system.rootobjects:
         r.append(fillSlots(item, root=taglink(o)))
     return tag[r]