@@ -1515,7 +1515,21 @@ def test(self, run_args):
15151515
15161516
15171517 def list (self , args ):
1518- logger .info ("Listing all scripts." )
1518+ self .action_type = "script"
1519+ run_args = {"fetch_all" : True } # to fetch the details of all the scripts present in repos registered in mlc
1520+
1521+ res = self .search (run_args )
1522+ if res ['return' ] > 0 :
1523+ return res
1524+
1525+ logger .info (f"Listing all the scripts and their paths present in repos which are registered in MLC" )
1526+ print ("......................................................" )
1527+ for item in res ['list' ]:
1528+ print (f"alias: { item .meta ['alias' ] if item .meta .get ('alias' ) else 'None' } " )
1529+ print (f"Location: { item .path } " )
1530+ print ("......................................................" )
1531+
1532+ return {"return" : 0 }
15191533
15201534
15211535class ScriptExecutionError (Exception ):
@@ -1579,7 +1593,20 @@ def show(self, run_args):
15791593 return {'return' : 0 }
15801594
15811595 def list (self , args ):
1582- logger .info ("Listing all caches." )
1596+ self .action_type = "cache"
1597+ run_args = {"fetch_all" : True } # to fetch the details of all the caches generated
1598+
1599+ res = self .search (run_args )
1600+ if res ['return' ] > 0 :
1601+ return res
1602+
1603+ logger .info (f"Listing all the caches and their paths" )
1604+ print ("......................................................" )
1605+ for item in res ['list' ]:
1606+ print (f"tags: { item .meta ['tags' ] if item .meta .get ('tags' ) else 'None' } " )
1607+ print (f"Location: { item .path } " )
1608+ print ("......................................................" )
1609+
15831610 return {'return' : 0 }
15841611
15851612class ExperimentAction (Action ):
0 commit comments