Skip to content

Commit

Permalink
Add serial number
Browse files Browse the repository at this point in the history
  • Loading branch information
nlpsuge committed Nov 28, 2021
1 parent 19cce5a commit 2b27148
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion xsession_manager/arguments_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,16 @@ def handle_arguments(args: Namespace):
xsm.restore_session(pop_up_a_dialog_to_restore, restoring_interval)

if list_sessions:
print()
import os
walk = os.walk(constants.Locations.BASE_LOCATION_OF_SESSIONS)
num = 0
for root, dirs, files in walk:
for file in files:
with open(Path(root, file), 'r') as f:
num = num + 1
namespace_objs: XSessionConfig = json.load(f, object_hook=lambda d: Namespace(**d))
print(namespace_objs.session_name, namespace_objs.session_create_time, str(Path(root, file)),
print(str(num) +'. ' + namespace_objs.session_name, namespace_objs.session_create_time, str(Path(root, file)),
sep=' ')

break
Expand Down

0 comments on commit 2b27148

Please sign in to comment.