Skip to content

Commit 57fcc90

Browse files
committed
rename app_list
1 parent 0a8b9ba commit 57fcc90

4 files changed

Lines changed: 90 additions & 101 deletions

File tree

nbs/00_cli.ipynb

Lines changed: 71 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -468,58 +468,32 @@
468468
"text": [
469469
"usage: plash_deploy [-h] [--path PATH] [--name NAME] [--force_data]\n",
470470
"\n",
471-
"Deploys app to production. By d"
472-
]
473-
},
474-
{
475-
"name": "stdout",
476-
"output_type": "stream",
477-
"text": [
478-
"efault, this command erases all files in your app which are not in data/. Then uploads\n",
479-
"all files and"
480-
]
481-
},
482-
{
483-
"name": "stdout",
484-
"output_type": "stream",
485-
"text": [
486-
" folders, except paths starting with `.` and except the local data/ directory. If `--force_data` is "
487-
]
488-
},
489-
{
490-
"name": "stdout",
491-
"output_type": "stream",
492-
"text": [
493-
"used,\n",
494-
"then it erases all files in production. Then it uploads all files and folders, including `data"
471+
"options:\n",
472+
" -h, --help show t"
495473
]
496474
},
497475
{
498476
"name": "stdout",
499477
"output_type": "stream",
500478
"text": [
501-
"/`, except paths starting\n",
502-
"with `.`.\n",
503-
"\n",
504-
"options:\n",
505-
" -h, --help show this help message and exit\n",
506-
" --pa"
479+
"his help message and exit\n",
480+
" --path PATH Path to project (default: .)\n",
481+
" --name NAME Overrides the"
507482
]
508483
},
509484
{
510485
"name": "stdout",
511486
"output_type": "stream",
512487
"text": [
513-
"th PATH Path to project (default: .)\n",
514-
" --name NAME Overrides the .plash file in project root if "
488+
" .plash file in project root if provided\n",
489+
" --force_data Overwrite data/ directory during deployment"
515490
]
516491
},
517492
{
518493
"name": "stdout",
519494
"output_type": "stream",
520495
"text": [
521-
"provided\n",
522-
" --force_data Overwrite data/ directory during deployment (default: False)\n"
496+
" (default: False)\n"
523497
]
524498
}
525499
],
@@ -538,7 +512,7 @@
538512
"#| export\n",
539513
"@call_parse\n",
540514
"def view(\n",
541-
" path:Path=Path('.'), # Path to project directory\n",
515+
" path:Path='.', # Path to project directory\n",
542516
" name:str=None, # Overrides the .plash file in project root if provided\n",
543517
"):\n",
544518
" \"Open your app in the browser\"\n",
@@ -605,7 +579,7 @@
605579
"source": [
606580
"#| export\n",
607581
"def delete(\n",
608-
" path:Path=Path('.'), # Path to project\n",
582+
" path:Path='.', # Path to project\n",
609583
" name:str=None): # Overrides the .plash file in project root if provided\n",
610584
" 'Delete your deployed app'\n",
611585
" name = _prep(path, name)\n",
@@ -691,7 +665,7 @@
691665
"source": [
692666
"#| export\n",
693667
"def start(\n",
694-
" path:Path=Path('.'), # Path to project\n",
668+
" path:Path='.', # Path to project\n",
695669
" name:str=None): # Overrides the .plash file in project root if provided\n",
696670
" 'Start your deployed app'\n",
697671
" name = _prep(path, name)\n",
@@ -727,19 +701,24 @@
727701
"text": [
728702
"usage: plash_start [-h] [--path PATH] [--name NAME]\n",
729703
"\n",
730-
"Start your deployed app\n",
731-
"\n",
732704
"options:\n",
733-
" -h, --help "
705+
" -h, --help show this help message "
706+
]
707+
},
708+
{
709+
"name": "stdout",
710+
"output_type": "stream",
711+
"text": [
712+
"and exit\n",
713+
" --path PATH Path to project (default: .)\n",
714+
" --name NAME Overrides the .plash file in pro"
734715
]
735716
},
736717
{
737718
"name": "stdout",
738719
"output_type": "stream",
739720
"text": [
740-
" show this help message and exit\n",
741-
" --path PATH (default: .)\n",
742-
" --name NAME\n"
721+
"ject root if provided\n"
743722
]
744723
}
745724
],
@@ -757,7 +736,7 @@
757736
"source": [
758737
"#| export\n",
759738
"def stop(\n",
760-
" path:Path=Path('.'), # Path to project\n",
739+
" path:Path='.', # Path to project\n",
761740
" name:str=None): # Overrides the .plash file in project root if provided\n",
762741
" 'Stop your deployed app'\n",
763742
" name = _prep(path, name)\n",
@@ -793,19 +772,24 @@
793772
"text": [
794773
"usage: plash_stop [-h] [--path PATH] [--name NAME]\n",
795774
"\n",
796-
"Stop your deployed app\n",
797-
"\n",
798775
"options:\n",
799-
" -h, --help "
776+
" -h, --help show this help message a"
800777
]
801778
},
802779
{
803780
"name": "stdout",
804781
"output_type": "stream",
805782
"text": [
806-
"show this help message and exit\n",
807-
" --path PATH (default: .)\n",
808-
" --name NAME\n"
783+
"nd exit\n",
784+
" --path PATH Path to project (default: .)\n",
785+
" --name NAME Overrides the .plash file in proj"
786+
]
787+
},
788+
{
789+
"name": "stdout",
790+
"output_type": "stream",
791+
"text": [
792+
"ect root if provided\n"
809793
]
810794
}
811795
],
@@ -834,7 +818,7 @@
834818
"source": [
835819
"#| export\n",
836820
"def logs(\n",
837-
" path:Path=Path('.'), # Path to project\n",
821+
" path:Path='.', # Path to project\n",
838822
" name:str=None, # Overrides the .plash file in project root if provided\n",
839823
" mode:log_modes='build'): # Choose between build or app logs\n",
840824
" 'Get logs for your deployed app'\n",
@@ -882,42 +866,33 @@
882866
"text": [
883867
"usage: plash_logs [-h] [--path PATH] [--name NAME] [--mode {build,app}] [--tail]\n",
884868
"\n",
885-
"Prints the logs fo"
886-
]
887-
},
888-
{
889-
"name": "stdout",
890-
"output_type": "stream",
891-
"text": [
892-
"r your deployed app\n",
893-
"\n",
894869
"options:\n",
895-
" -h, --help show this help message and exit\n",
896-
" --path PATH "
870+
" -h, --h"
897871
]
898872
},
899873
{
900874
"name": "stdout",
901875
"output_type": "stream",
902876
"text": [
903-
" Path to project (default: .)\n",
904-
" --name NAME Overrides the .plash file in project root i"
877+
"elp show this help message and exit\n",
878+
" --path PATH Path to project (default: .)\n",
879+
" --"
905880
]
906881
},
907882
{
908883
"name": "stdout",
909884
"output_type": "stream",
910885
"text": [
911-
"f provided\n",
912-
" --mode {build,app} Choose between build or app logs (default: build)\n",
913-
" --tail "
886+
"name NAME Overrides the .plash file in project root if provided\n",
887+
" --mode {build,app} Choose"
914888
]
915889
},
916890
{
917891
"name": "stdout",
918892
"output_type": "stream",
919893
"text": [
920-
" Tail the logs (default: False)\n"
894+
" between build or app logs (default: build)\n",
895+
" --tail Tail the logs (default: False)\n"
921896
]
922897
}
923898
],
@@ -985,7 +960,7 @@
985960
"source": [
986961
"#| export\n",
987962
"def download(\n",
988-
" path:Path=Path('.'), # Path to project\n",
963+
" path:Path='.', # Path to project\n",
989964
" name:str=None, # Overrides the .plash file in project root if provided\n",
990965
" save_path:Path=\"./download/\"): # Save path (optional)\n",
991966
" \"Download deployed app to save_path.\"\n",
@@ -1027,34 +1002,31 @@
10271002
"text": [
10281003
"usage: plash_download [-h] [--path PATH] [--name NAME] [--save_path SAVE_PATH]\n",
10291004
"\n",
1030-
"Download your deploy"
1005+
"options:\n",
1006+
" -h, --hel"
10311007
]
10321008
},
10331009
{
10341010
"name": "stdout",
10351011
"output_type": "stream",
10361012
"text": [
1037-
"ed app\n",
1038-
"\n",
1039-
"options:\n",
1040-
" -h, --help show this help message and exit\n",
1041-
" --path PATH P"
1013+
"p show this help message and exit\n",
1014+
" --path PATH Path to project (default: .)\n"
10421015
]
10431016
},
10441017
{
10451018
"name": "stdout",
10461019
"output_type": "stream",
10471020
"text": [
1048-
"ath to project (default: .)\n",
1049-
" --name NAME Overrides the .plash file in project root if pr"
1021+
" --name NAME Overrides the .plash file in project root if provided\n",
1022+
" --save_path SAVE_PA"
10501023
]
10511024
},
10521025
{
10531026
"name": "stdout",
10541027
"output_type": "stream",
10551028
"text": [
1056-
"ovided\n",
1057-
" --save_path SAVE_PATH Save path (optional) (default: download)\n"
1029+
"TH Save path (optional) (default: ./download/)\n"
10581030
]
10591031
}
10601032
],
@@ -1071,19 +1043,19 @@
10711043
"outputs": [],
10721044
"source": [
10731045
"#| export\n",
1074-
"def apps():\n",
1046+
"def app_list():\n",
10751047
" \"List your deployed apps\"\n",
10761048
" r = _mk_auth_req(_endpoint(rt=\"/user_apps\"))\n",
10771049
" if not r: raise PlashError('Failed to retrieve')\n",
10781050
" return r.json()\n",
10791051
"\n",
10801052
"@call_parse\n",
1081-
"def _apps(verbose:bool=False): # Whether to show running status as well as name: 1=running, 0=stopped\n",
1053+
"def _app_list(verbose:bool=False): # Whether to show running status as well as name: 1=running, 0=stopped\n",
10821054
" try: res = apps()\n",
10831055
" except PlashError as e: return str(e)\n",
10841056
" if not res: print(\"You don't have any deployed Plash apps.\")\n",
10851057
" for a in res: print(f\"{a['running']} {a['name']}\" if verbose else a['name'])\n",
1086-
"_apps.__doc__ = apps.__doc__"
1058+
"_app_list.__doc__ = app_list.__doc__"
10871059
]
10881060
},
10891061
{
@@ -1106,18 +1078,16 @@
11061078
"text": [
11071079
"usage: plash_apps [-h] [--verbose]\n",
11081080
"\n",
1109-
"List your deployed apps (verbose shows status table: 1=running, "
1081+
"options:\n",
1082+
" -h, --help show this help message and exit\n",
1083+
" --verbo"
11101084
]
11111085
},
11121086
{
11131087
"name": "stdout",
11141088
"output_type": "stream",
11151089
"text": [
1116-
"0=stopped)\n",
1117-
"\n",
1118-
"options:\n",
1119-
" -h, --help show this help message and exit\n",
1120-
" --verbose (default: False)\n"
1090+
"se Whether to show running status as well as name: 1=running, 0=stopped (default: False)\n"
11211091
]
11221092
}
11231093
],
@@ -1126,6 +1096,19 @@
11261096
"plash_apps --help"
11271097
]
11281098
},
1099+
{
1100+
"cell_type": "code",
1101+
"execution_count": null,
1102+
"id": "6ff07c8d",
1103+
"metadata": {},
1104+
"outputs": [],
1105+
"source": [
1106+
"#| export\n",
1107+
"def plash_tool_info():\n",
1108+
" from dialoghelper import add_msg\n",
1109+
" add_msg('Plash tools: &`[login, deploy, delete, start, stop, logs, download, app_list]`')"
1110+
]
1111+
},
11291112
{
11301113
"cell_type": "markdown",
11311114
"id": "3748636e",

plash_cli/_modidx.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
'plash_cli.auth.mk_signin_url': ('auth.html#mk_signin_url', 'plash_cli/auth.py')},
1313
'plash_cli.cli': { 'plash_cli.cli.Path._is_dir_empty': ('cli.html#path._is_dir_empty', 'plash_cli/cli.py'),
1414
'plash_cli.cli.PlashError': ('cli.html#plasherror', 'plash_cli/cli.py'),
15-
'plash_cli.cli._apps': ('cli.html#_apps', 'plash_cli/cli.py'),
15+
'plash_cli.cli._app_list': ('cli.html#_app_list', 'plash_cli/cli.py'),
1616
'plash_cli.cli._delete': ('cli.html#_delete', 'plash_cli/cli.py'),
1717
'plash_cli.cli._deploy': ('cli.html#_deploy', 'plash_cli/cli.py'),
1818
'plash_cli.cli._deps': ('cli.html#_deps', 'plash_cli/cli.py'),
@@ -28,13 +28,14 @@
2828
'plash_cli.cli._start': ('cli.html#_start', 'plash_cli/cli.py'),
2929
'plash_cli.cli._stop': ('cli.html#_stop', 'plash_cli/cli.py'),
3030
'plash_cli.cli._validate_app': ('cli.html#_validate_app', 'plash_cli/cli.py'),
31-
'plash_cli.cli.apps': ('cli.html#apps', 'plash_cli/cli.py'),
31+
'plash_cli.cli.app_list': ('cli.html#app_list', 'plash_cli/cli.py'),
3232
'plash_cli.cli.create_tar_archive': ('cli.html#create_tar_archive', 'plash_cli/cli.py'),
3333
'plash_cli.cli.delete': ('cli.html#delete', 'plash_cli/cli.py'),
3434
'plash_cli.cli.deploy': ('cli.html#deploy', 'plash_cli/cli.py'),
3535
'plash_cli.cli.download': ('cli.html#download', 'plash_cli/cli.py'),
3636
'plash_cli.cli.login': ('cli.html#login', 'plash_cli/cli.py'),
3737
'plash_cli.cli.logs': ('cli.html#logs', 'plash_cli/cli.py'),
38+
'plash_cli.cli.plash_tool_info': ('cli.html#plash_tool_info', 'plash_cli/cli.py'),
3839
'plash_cli.cli.start': ('cli.html#start', 'plash_cli/cli.py'),
3940
'plash_cli.cli.stop': ('cli.html#stop', 'plash_cli/cli.py'),
4041
'plash_cli.cli.view': ('cli.html#view', 'plash_cli/cli.py')}}}

0 commit comments

Comments
 (0)