Skip to content

Commit

Permalink
Merge ce23f89 into 89f18ce
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Haylett authored Nov 14, 2019
2 parents 89f18ce + ce23f89 commit 4173093
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions i3_resurrect/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ def list_workspaces(directory, item):
workspaces = []
for entry in directory.iterdir():
if entry.is_file():
tokens = entry.name.split('_')
workspace = tokens[1]
temp = tokens[2]
file_type = temp[:temp.index('.json')]
name = entry.name
name = name[name.index('_') + 1:]
workspace = name[:name.rfind('_')]
file_type = name[name.rfind('_') + 1:name.index('.json')]
workspaces.append(f'Workspace {workspace} {file_type}')
workspaces = natsorted(workspaces)
for workspace in workspaces:
Expand All @@ -153,10 +153,9 @@ def list_workspaces(directory, item):
try:
for entry in directory.iterdir():
if entry.is_file():
tokens = entry.name.split('_')
profile = tokens[0]
temp = tokens[1]
file_type = temp[:temp.index('.json')]
name = entry.name
profile = name[:name.rfind('_')]
file_type = name[name.rfind('_') + 1:name.index('.json')]
profiles.append(f'Profile {profile} {file_type}')
profiles = natsorted(profiles)
for profile in profiles:
Expand Down

0 comments on commit 4173093

Please sign in to comment.