osTicket integration complete for ddrescue TUI
This commit is contained in:
parent
177a7fbec2
commit
28c1d61d20
1 changed files with 12 additions and 2 deletions
|
|
@ -702,6 +702,8 @@ class State():
|
||||||
self.mode,
|
self.mode,
|
||||||
self.destination,
|
self.destination,
|
||||||
force_local=docopt_args['--force-local-map'],
|
force_local=docopt_args['--force-local-map'],
|
||||||
|
ticket_id=self.ost.ticket_id,
|
||||||
|
ticket_name=self.ost.ticket_name,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Start fresh if requested
|
# Start fresh if requested
|
||||||
|
|
@ -1619,9 +1621,9 @@ def get_table_type(disk):
|
||||||
return table_type
|
return table_type
|
||||||
|
|
||||||
|
|
||||||
def get_working_dir(mode, destination, force_local=False):
|
def get_working_dir(
|
||||||
|
mode, destination, force_local=False, ticket_id=None, ticket_name=None):
|
||||||
"""Get working directory using mode and destination, returns path."""
|
"""Get working directory using mode and destination, returns path."""
|
||||||
ticket_id = None
|
|
||||||
working_dir = None
|
working_dir = None
|
||||||
|
|
||||||
# Set ticket ID
|
# Set ticket ID
|
||||||
|
|
@ -1662,6 +1664,12 @@ def get_working_dir(mode, destination, force_local=False):
|
||||||
if mode == 'Clone':
|
if mode == 'Clone':
|
||||||
working_dir = working_dir.joinpath(ticket_id)
|
working_dir = working_dir.joinpath(ticket_id)
|
||||||
|
|
||||||
|
# Append ticket name if set
|
||||||
|
if ticket_name:
|
||||||
|
working_dir = working_dir.with_name(
|
||||||
|
f'{ticket_id}_{ticket_name.replace(" ", "-")}',
|
||||||
|
)
|
||||||
|
|
||||||
# Create directory
|
# Create directory
|
||||||
working_dir.mkdir(parents=True, exist_ok=True)
|
working_dir.mkdir(parents=True, exist_ok=True)
|
||||||
os.chdir(working_dir)
|
os.chdir(working_dir)
|
||||||
|
|
@ -1686,6 +1694,8 @@ def main():
|
||||||
main_menu = build_main_menu()
|
main_menu = build_main_menu()
|
||||||
settings_menu = build_settings_menu()
|
settings_menu = build_settings_menu()
|
||||||
state = State()
|
state = State()
|
||||||
|
if not args['--force-local-map']:
|
||||||
|
state.ost.select_ticket()
|
||||||
try:
|
try:
|
||||||
state.init_recovery(args)
|
state.init_recovery(args)
|
||||||
except std.GenericAbort:
|
except std.GenericAbort:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue