Skip to content

Commit

Permalink
Merge pull request #14 from janhaviiii/main
Browse files Browse the repository at this point in the history
Added TUI
  • Loading branch information
ABHAY0O7 authored Oct 15, 2022
2 parents 91b2ab0 + fa838ba commit bf898b1
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
37 changes: 37 additions & 0 deletions main.py
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/
21 changes: 21 additions & 0 deletions util.py
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}')

0 comments on commit bf898b1

Please sign in to comment.