Пример #1
0
Файл: dump.py Проект: yaccz/cpk
    def _run(self,args):
        for x in session.query(Attribute).all():
            if x.description:
                # If there are no descriptions, there is no point in
                # dumping attributes as there is no additional
                # information as the short names are part of node path
                raise RuntimeError("Description in an attribute")


        total = self.dfs(Node.root().lower(), lambda x: None)
        dumped = self.dfs(Node.root().lower(), self.dump)
        if total != dumped:
            raise RuntimeError("Dumped {} leafs but {} found in total".format(dumped, total))
Пример #2
0
Файл: list.py Проект: yaccz/cpk
 def children(self):
     if not self.args.nodes:
         return Node.root().lower()
     try:
         return Node.get(self.tokens_2_filters(self.tokenize_nodes())).lower()
     except exc.MatchedMultiple as e:
         import sys
         print("Couldnt match exactly, listing node: %s %s" % (e.last.attr.name, e.last.value), file=sys.stderr)
         return e.matched