55from urllib import request
66import os
77import argparse
8-
8+ import pkg_resources
9+ import shutil
910from .handlers .request_folder import request_folder
1011from .handlers .request_submodule import get_submodule_config , request_submodule_library
1112
1213def init_xircuits ():
1314
14- import pkg_resources
15- import shutil
15+
1616 path = ".xircuits"
1717 config_path = pkg_resources .resource_filename ('xircuits' , '.xircuits' )
1818 shutil .copytree (config_path , path )
@@ -60,7 +60,7 @@ def download_submodule_library():
6060def main ():
6161
6262 parser = argparse .ArgumentParser ()
63- parser .add_argument ('--branch' , nargs = '?' , default = "master" , help = 'pull files from a xircuits branch' )
63+ parser .add_argument ('--branch' , nargs = '?' , help = 'pull files from a xircuits branch' )
6464
6565 parsed , extra_args = parser .parse_known_args ()
6666
@@ -76,7 +76,12 @@ def main():
7676 if not component_library_path .exists ():
7777 val = input ("Xircuits Component Library is not found. Would you like to load it in the current path (Y/N)? " )
7878 if val .lower () == ("y" or "yes" ):
79- request_folder ("xai_components" , branch = args .branch )
79+ if args .branch is None :
80+ xai_component_path = pkg_resources .resource_filename ('xai_components' , '' )
81+ shutil .copytree (xai_component_path , "xai_components" )
82+
83+ else :
84+ request_folder ("xai_components" , branch = args .branch )
8085
8186 # handler for extra jupyterlab launch options
8287 if extra_args :
0 commit comments