Minor code enhancements
This commit is contained in:
+22
-21
@@ -933,28 +933,29 @@ class Sheerka(Concept):
|
||||
defs = self.sdp.get(self.CONCEPTS_DEFINITIONS_ENTRY)
|
||||
self.log.info(defs)
|
||||
|
||||
def dump_desc(self, concept_name):
|
||||
if isinstance(concept_name, Concept):
|
||||
concepts = concept_name
|
||||
else:
|
||||
concepts = self.get(concept_name)
|
||||
if self.isinstance(concepts, BuiltinConcepts.UNKNOWN_CONCEPT):
|
||||
self.log.error("Concept unknown")
|
||||
return False
|
||||
|
||||
if not hasattr(concepts, "__iter__"):
|
||||
concepts = [concepts]
|
||||
|
||||
def dump_desc(self, *concept_names):
|
||||
first = True
|
||||
for c in concepts:
|
||||
if not first:
|
||||
self.log.info("")
|
||||
self.log.info(f"name : {c.name}")
|
||||
self.log.info(f"bnf : {c.metadata.definition}")
|
||||
self.log.info(f"key : {c.key}")
|
||||
self.log.info(f"body : {c.body}")
|
||||
self.log.info(f"digest : {c.get_digest()}")
|
||||
first = False
|
||||
for concept_name in concept_names:
|
||||
if isinstance(concept_name, Concept):
|
||||
concepts = concept_name
|
||||
else:
|
||||
concepts = self.get(concept_name)
|
||||
if self.isinstance(concepts, BuiltinConcepts.UNKNOWN_CONCEPT):
|
||||
self.log.error(f"Concept '{concept_name}' is unknown")
|
||||
return False
|
||||
|
||||
if not hasattr(concepts, "__iter__"):
|
||||
concepts = [concepts]
|
||||
|
||||
for c in concepts:
|
||||
if not first:
|
||||
self.log.info("")
|
||||
self.log.info(f"name : {c.name}")
|
||||
self.log.info(f"bnf : {c.metadata.definition}")
|
||||
self.log.info(f"key : {c.key}")
|
||||
self.log.info(f"body : {c.body}")
|
||||
self.log.info(f"digest : {c.get_digest()}")
|
||||
first = False
|
||||
|
||||
@staticmethod
|
||||
def get_builtins_classes_as_dict():
|
||||
|
||||
Reference in New Issue
Block a user