def iterstandards(self, items=["standard"], **kwargs): """ Iterator over all standards of the repo. Possible items to request: standard, multistandard, body, collection, class """ check_iterator_arguments( items, "standard", ["multistandard", "body", "collection", "class"], kwargs) for std in self.standards.values(): its = {"standard": std} its["class"] = self.class_standards.get_src(std) its["body"] = self.body_standards.get_src(std) if self.multistandard_standards.contains_dst(std): its["multistandard"] = self.multistandard_standards.get_src( std) its["collection"] = self.collection_multistandards.get_src( its["multistandard"]) else: its["multistandard"] = None its["collection"] = self.collection_standards.get_src(std) if filter_iterator_items(its, kwargs): yield tuple(its[key] for key in items)
def iterclasses(self, items=["class"], **kwargs): """ Iterator over all classes of the repo. Possible items to request: class, collection """ check_iterator_arguments(items, "class", ["collection"], kwargs) for cl in self.classes.values(): its = {"class": cl} its["collection"] = self.collection_classes.get_src(cl) if filter_iterator_items(its, kwargs): yield tuple(its[key] for key in items)
def iterscadfiles(self,items=["scadfile"],**kwargs): """ Iterator over all OpenSCAD files of the repo. Possible items to request: scadfile, collection """ check_iterator_arguments(items,"scadfile",["collection"],kwargs) for sf in self.scadfiles: its = {"scadfile" : sf} its["collection"] = self.collection_scadfiles.get_src(sf) if filter_iterator_items(its,kwargs): yield tuple(its[key] for key in items)
def iterscadfiles(self, items=["scadfile"], **kwargs): """ Iterator over all OpenSCAD files of the repo. Possible items to request: scadfile, collection """ check_iterator_arguments(items, "scadfile", ["collection"], kwargs) for sf in self.scadfiles: its = {"scadfile": sf} its["collection"] = self.collection_scadfiles.get_src(sf) if filter_iterator_items(its, kwargs): yield tuple(its[key] for key in items)
def iterclasses(self,items=["class"],**kwargs): """ Iterator over all classes of the repo. Possible items to request: class, collection, base """ check_iterator_arguments(items,"class",["collection","base"],kwargs) for cl,coll in self.repo.iterclasses(["class","collection"]): its = {"class" : cl, "collection" : coll} if self.base_classes.contains_dst(cl): its["base"] = self.base_classes.get_src(cl) if filter_iterator_items(its,kwargs): yield tuple(its[key] for key in items)
def iterbases(self,items=["base"],**kwargs): """ Iterator over all freecad bases of the repo. Possible items to request: base, classes, collection """ check_iterator_arguments(items,"base",["classes", "collection"],kwargs) for base in self.bases: its = {"base" : base} its["collection"] = self.collection_bases.get_src(base) its["classes"] = self.base_classes.get_dsts(base) if filter_iterator_items(its,kwargs): yield tuple(its[key] for key in items)
def iternames(self,items=["name"],**kwargs): """ Iterator over all names of the repo. Possible items to request: name, multiname, collection, class, base """ check_iterator_arguments(items,"name",["multiname", "collection","class","base"],kwargs) parent = ["name","multiname", "collection","class"] for tup in self.repo.iternames(parent): its = dict(zip(parent,tup)) if self.base_classes.contains_dst(its["class"]): its["base"] = self.base_classes.get_src(its["class"]) if filter_iterator_items(its,kwargs): yield tuple(its[key] for key in items)
def itermodules(self, items=["module"], **kwargs): """ Iterator over all OpenSCAD modules of the repo. Possible items to request: module, classes, collection """ check_iterator_arguments(items, "module", ["classes", "collection"], kwargs) for module in self.modules: its = {"module": module} its["collection"] = self.collection_modules.get_src(module) its["classes"] = self.module_classes.get_dsts(module) if filter_iterator_items(its, kwargs): yield tuple(its[key] for key in items)
def iterdimdrawings(self, items=["dimdrawing"], **kwargs): """ Iterator over all dimension drawings of the repo. Possible items to request: dimdrawing, classes, collection """ check_iterator_arguments(items, "dimdrawing", ["classes", "collection"], kwargs) for draw in self.dimdrawings: its = {"dimdrawing": draw} its["collection"] = self.collection_dimdrawings.get_src(draw) its["classes"] = self.dimdrawing_classes.get_dsts(draw) if filter_iterator_items(its, kwargs): yield tuple(its[key] for key in items)
def itermultinames(self, items=["multiname"], **kwargs): """ Iterator over all multinames of the repo. Possible items to rerquest: multiname, names, collection """ check_iterator_arguments(items, "multiname", ["names", "collection"], kwargs) for mname in self.multinames.values(): its = {"multiname": mname} its["names"] = self.multiname_names.get_dsts(mname) its["collection"] = self.collection_multinames.get_src(mname) if filter_iterator_items(its, kwargs): yield tuple(its[key] for key in items)
def itermultistandards(self, items=["multistandard"], **kwargs): """ Iterator over all multistandards of the repo. Possible items to rerquest: multistandard, standards, collection, body """ check_iterator_arguments(items, "multistandard", ["standards", "collection", "body"], kwargs) for mstandard in self.multistandards.values(): its = {"multistandard": mstandard} its["standards"] = self.multistandard_standards.get_dsts(mstandard) its["collection"] = self.collection_multistandards.get_src( mstandard) its["body"] = self.body_multistandards.get_src(mstandard) if filter_iterator_items(its, kwargs): yield tuple(its[key] for key in items)
def iternames(self, items=["name"], **kwargs): """ Iterator over all names of the repo. Possible items to request: name, multiname, collection, class """ check_iterator_arguments(items, "name", ["multiname", "collection", "class"], kwargs) for name in self.names.values(): its = {"name": name} its["class"] = self.class_names.get_src(name) if self.multiname_names.contains_dst(name): its["multiname"] = self.multiname_names.get_src(name) its["collection"] = self.collection_multinames.get_src( multiname) else: its["multiname"] = None its["collection"] = self.collection_names.get_src(name) if filter_iterator_items(its, kwargs): yield tuple(its[key] for key in items)
def iterstandards(self, items=["standard"], **kwargs): """ Iterator over all standards of the repo. Possible items to request: standard, multistandard, collection, class, module """ check_iterator_arguments( items, "standard", ["multistandard", "collection", "class", "module"], kwargs) for standard, multistandard, coll, cl in self.repo.iterstandards( ["standard", "multistandard", "collection", "class"]): its = { "standard": standard, "multistandard": multistandard, "collection": coll, "class": cl } if self.module_classes.contains_dst(cl): its["module"] = self.module_classes.get_src(cl) if filter_iterator_items(its, kwargs): yield tuple(its[key] for key in items)
def iterclasses(self, items=["class"], **kwargs): """ Iterator over all classes of the repo. Possible items to request: class, collection, dimdrawing, condrawings """ check_iterator_arguments(items, "class", ["collection", "dimdrawing", "condrawings"], kwargs) for cl, coll in self.repo.iterclasses(["class", "collection"]): its = {"class": cl, "collection": coll} if self.condrawings_classes.contains_dst(cl): its["condrawings"] = self.condrawings_classes.get_srcs(cl) else: its["condrawings"] = [] if self.dimdrawing_classes.contains_dst(cl): its["dimdrawing"] = self.dimdrawing_classes.get_src(cl) else: its["dimdrawing"] = None if filter_iterator_items(its, kwargs): yield tuple(its[key] for key in items)