MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / group_list

Method group_list

mod/project/java/groupMod.py:739–760  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

737 self.project_cache = _cache
738
739 def group_list(self) -> List[dict]:
740 group_list = []
741 for i in os.listdir(Group.GROUP_DATA_DIR):
742 file = "{}/{}".format(Group.GROUP_DATA_DIR, i)
743 if os.path.isfile(file) and i.endswith(".json"):
744 group_id = i[:-5]
745 try:
746 data = json.loads(public.readFile(file))
747 except:
748 continue
749 g = Group(group_id, data)
750 group_list.append(g)
751
752 if not group_list:
753 return []
754
755 self._get_project_cache()
756 res = []
757 for i in group_list:
758 res.append(i.group_info(self.project_cache))
759
760 return res
761
762 @staticmethod
763 def add_group(data: dict) -> Optional[str]:

Callers

nothing calls this directly

Calls 8

_get_project_cacheMethod · 0.95
listdirMethod · 0.80
readFileMethod · 0.80
GroupClass · 0.70
formatMethod · 0.45
loadsMethod · 0.45
appendMethod · 0.45
group_infoMethod · 0.45

Tested by

no test coverage detected