Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Search for disabled soundpack in the update process
Browse files Browse the repository at this point in the history
  • Loading branch information
remyroy committed Jan 15, 2016
1 parent e9845d0 commit bfebf4c
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions cddagl/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1651,14 +1651,23 @@ def timeout():

def asset_name(self, path, filename):
asset_file = os.path.join(path, filename)
if os.path.isfile(asset_file):
with open(asset_file, 'r') as f:
for line in f:
if line.startswith('NAME'):
space_index = line.find(' ')
name = line[space_index:].strip().replace(
',', '')
return name

if not os.path.isfile(asset_file):
disabled_asset_file = os.path.join(path, filename + '.disabled')
if not os.path.isfile(disabled_asset_file):
return None
else:
asset_file_path = disabled_asset_file
else:
asset_file_path = asset_file

with open(asset_file_path, 'r') as f:
for line in f:
if line.startswith('NAME'):
space_index = line.find(' ')
name = line[space_index:].strip().replace(
',', '')
return name
return None

def mod_ident(self, path):
Expand Down

0 comments on commit bfebf4c

Please sign in to comment.