11# File contains all public methods of the scblpy package
22import json
33import sys
4+ import urllib
45
56import requests
67
@@ -198,7 +199,10 @@ def upload(mod, feature_vector, docs={}, email=True, _keep=False) -> bool:
198199
199200 # user feedback:
200201 if not glob .SILENT :
201- print ("Your model was successfully uploaded. \n " )
202+ print ("Your model was successfully uploaded to Scailable!" )
203+ print ("NOTE: After transpiling, we will send you an email and your model will be available at "
204+ "https://admin.sclbl.net." )
205+ print ("Or, alternatively, you can use the 'endpoints()' function to list all your uploaded models. \n " )
202206
203207 # remove bundle:
204208 if not _keep :
@@ -643,8 +647,7 @@ def endpoints(_verbose=True) -> dict:
643647 result = json .loads (response .text )
644648 except Exception as e :
645649 if not glob .SILENT :
646- print ("We were unable retrieve your endpoints. \n "
647- "Please try again later." )
650+ print ("We were unable retrieve your endpoints." )
648651 if glob .DEBUG :
649652 raise UserManagerError ("Unable to retrieve endpoints. " + str (e ))
650653 return False
@@ -653,10 +656,27 @@ def endpoints(_verbose=True) -> dict:
653656 if _verbose and not glob .SILENT :
654657 if not result :
655658 print ("You currently do not own any active endpoints." )
659+ print ("\n Need help getting started?" )
660+ print (" - See the sclblpy docs at https://pypi.org/project/sclblpy/." )
661+ print (" - See our getting started tutorial at "
662+ "https://github.com/scailable/sclbl-tutorials/tree/master/sclbl-101-getting-started." )
663+ print (" - Or, login to your admin at https://admin.sclbl.net. \n " )
664+ print ("NOTE: if you have just uploaded a model, please check your email; we will let you know when its "
665+ "available!\n " )
656666 else :
657- print ("You currently own the following endpoints:" )
667+ # Pretty printing of list
668+ baseUrl = glob .EXAMPLE__BASE_URL
669+ i = 1
670+ print ("You currently own the following endpoints:\n " )
658671 for key in result :
659- print ('Name: {}, cfid: {}.' .format (key ['name' ], key ['cfid' ]))
672+ url = baseUrl + "?cfid=" + key ['cfid' ]
673+ url += "&exin=" + urllib .parse .quote (key ['exampleinput' ])
674+
675+ print (' {}: {}, \n '
676+ ' - cfid: {} \n '
677+ ' - example: {} \n ' .format (i , key ['name' ], key ['cfid' ], url ))
678+ i = i + 1
679+ print ("Login at https://admin.sclbl.net to administer your endpoints and see integration examples.\n " )
660680
661681 return result
662682
0 commit comments