mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2026-02-23 15:49:50 +01:00
fix getting args.root, ask feedback only on success and keyboard interrupt (not on exceptions), fix terminal width and erasing old logs
This commit is contained in:
@@ -42,10 +42,12 @@ def get_path_id():
|
||||
return hashlib.sha256(installation_directory.encode()).hexdigest()
|
||||
|
||||
|
||||
def exit_gpt_pilot():
|
||||
def exit_gpt_pilot(ask_feedback=True):
|
||||
path_id = get_path_id()
|
||||
send_telemetry(path_id)
|
||||
|
||||
feedback = get_user_feedback()
|
||||
feedback = None
|
||||
if ask_feedback:
|
||||
feedback = get_user_feedback()
|
||||
if feedback: # only send if user provided feedback
|
||||
send_feedback(feedback, path_id)
|
||||
|
||||
@@ -20,7 +20,7 @@ def setup_workspace(args):
|
||||
|
||||
return args['workspace']
|
||||
|
||||
root = args['root'] or get_parent_folder('pilot')
|
||||
root = args.get('root') or get_parent_folder('pilot')
|
||||
create_directory(root, 'workspace')
|
||||
project_path = create_directory(os.path.join(root, 'workspace'), args['name'])
|
||||
create_directory(project_path, 'tests')
|
||||
|
||||
@@ -200,7 +200,10 @@ def stream_gpt_completion(data, req_type):
|
||||
"""
|
||||
|
||||
# TODO add type dynamically - this isn't working when connected to the external process
|
||||
terminal_width = 50 # os.get_terminal_size().columns
|
||||
try:
|
||||
terminal_width = os.get_terminal_size().columns
|
||||
except OSError:
|
||||
terminal_width = 50
|
||||
lines_printed = 2
|
||||
gpt_response = ''
|
||||
buffer = '' # A buffer to accumulate incoming data
|
||||
|
||||
Reference in New Issue
Block a user