-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from janhaviiii/main
Added TUI
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# This is a sample Python script. | ||
|
||
# Press Shift+F10 to execute it or replace it with your code. | ||
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. | ||
|
||
import click | ||
|
||
@click.command() | ||
@click.option('--directory', '-d', help="Directory name", default="Backend") | ||
@click.option('--subdirectory', '-s', help="Sub-Directory name", default="Base") | ||
@click.option('--append', '-a', default=False, is_flag=True) | ||
@click.option('--class_name', '-c', help="Class name", default=None) | ||
@click.option('--user_id', '-uid', help="UserId", default="id") | ||
@click.option('--init', '-i', default=False, is_flag=True) | ||
@click.option('--json_path', '-j', help="Json Path", default=None) | ||
def print_hi(directory, subdirectory, init, append, class_name, user_id, json_path): | ||
if init: | ||
print(f'{directory}') | ||
print(f'{subdirectory}') | ||
|
||
if append: | ||
if json_path is None: | ||
print(f'Provide JsonPath with --append using --json_path option') | ||
return | ||
if class_name is None: | ||
class_name = json_path.split('/')[-1].split('.')[0] | ||
print(json_path) | ||
print(f'{class_name}') | ||
print(f'{user_id}') | ||
|
||
|
||
|
||
|
||
if __name__ == '__main__': | ||
print_hi() | ||
|
||
# See PyCharm help at https://www.jetbrains.com/help/pycharm/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
def print_colored(txt,color='blue',typeface='n'): | ||
color_codes = { | ||
'none' : '', | ||
'header' : '\033[95m', | ||
'blue' : '\033[94m', | ||
'cyan' : '\033[96m', | ||
'green' : '\033[92m', | ||
'warning' : '\033[93m', | ||
'fail' : '\033[91m', | ||
'red' : '\033[91m', | ||
} | ||
typefaces = { | ||
'n' : '', | ||
'b' : '\033[1m', | ||
'u' : '\033[4m' | ||
} | ||
tf = typefaces[typeface] | ||
endc = '\033[0m' | ||
col = color_codes[color] | ||
print(f'{col}{tf}{txt}{endc}') | ||
|