def install_atom_pkgs(*pkgs): for pkg in pkgs: try: print(apm("install", pkg,compatible=COMPATIBILITY_MODE, production=DEV_MODE)) print("Installed {}".format(pkg)) except Exception as e: print(e)
def stars(self): """ list stars packages """ cloud_list = sh.apm('stars') cloud_list = re.findall(r'\[33m([0-9a-zA-Z_-]+)\x1b\[39m([^\x1b]*)[^\d]*(\d+)[^\d]*(\d+)', cloud_list.stdout) return cloud_list
def list(self): """ list local packages """ local_list = sh.apm('list') local_list = re.search(r'atom/packages[\s\S]*$', local_list.stdout).group(0) local_list = re.findall(r' ([0-9a-zA-Z_-]+)@([0-9\.]+)\n', local_list) return local_list