Skip to content

Commit

Permalink
Fixed issue where Pyro and XSD did not agree on TES5 game type signature
Browse files Browse the repository at this point in the history
  • Loading branch information
fireundubh committed May 15, 2020
1 parent 5a0d9c1 commit af3c53f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pyro/PapyrusProject.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<xs:simpleType name="gameType">
<xs:restriction base="xs:string">
<xs:pattern value="[sS][sS][eE]"/>
<xs:pattern value="[tT][eE][sS]5"/>
<xs:pattern value="[tT][eE][sS][5vV]"/>
<xs:pattern value="[fF][oO]4"/>
</xs:restriction>
</xs:simpleType>
Expand Down
17 changes: 11 additions & 6 deletions pyro/ProjectBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ class ProjectBase:

options: ProjectOptions = None

game_types: dict = {'sse': 'Skyrim Special Edition', 'tesv': 'Skyrim', 'fo4': 'Fallout 4'}
game_types: dict = {
'sse': 'Skyrim Special Edition',
'tes5': 'Skyrim',
'tesv': 'Skyrim',
'fo4': 'Fallout 4'
}
variables: dict = {}

program_path: str = ''
Expand Down Expand Up @@ -125,7 +130,7 @@ def get_registry_path(self, game_type: str = '') -> str:
game_name = 'Fallout4'
elif game_type == 'sse':
game_name = 'Skyrim Special Edition'
elif game_type == 'tesv':
elif game_type in ('tes5', 'tesv'):
game_name = 'Skyrim'
else:
raise ValueError('Cannot determine registry path from game type')
Expand Down Expand Up @@ -217,7 +222,7 @@ def get_game_type(self) -> str:
return 'sse'
if game_path.endswith('skyrim'):
ProjectBase.log.warning('Using game type: Skyrim (determined from game path)')
return 'tesv'
return 'tes5'

if self.options.registry_path:
registry_path_parts = self.options.registry_path.casefold().split(os.sep)
Expand All @@ -229,7 +234,7 @@ def get_game_type(self) -> str:
return 'sse'
if 'skyrim' in registry_path_parts:
ProjectBase.log.warning('Using game type: Skyrim (determined from registry path)')
return 'tesv'
return 'tes5'

if self.import_paths:
for import_path in reversed(self.import_paths):
Expand All @@ -242,7 +247,7 @@ def get_game_type(self) -> str:
return 'sse'
if 'skyrim' in path_parts:
ProjectBase.log.warning('Using game type: Skyrim (determined from import paths)')
return 'tesv'
return 'tes5'

if self.options.flags_path:
flags_path = self.options.flags_path.casefold()
Expand All @@ -254,7 +259,7 @@ def get_game_type(self) -> str:
self.get_game_path('sse')
except FileNotFoundError:
ProjectBase.log.warning('Using game type: Skyrim (determined from flags path)')
return 'tesv'
return 'tes5'
else:
ProjectBase.log.warning('Using game type: Skyrim Special Edition (determined from flags path)')
return 'sse'
Expand Down
4 changes: 2 additions & 2 deletions pyro/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
_game_arguments = _parser.add_argument_group('game arguments')
_game_arguments.add_argument('-g', '--game-type',
action='store', type=str,
choices={'fo4', 'tesv', 'sse'},
help='set game type (choices: fo4, tesv, sse)')
choices={'fo4', 'tes5', 'tesv', 'sse'},
help='set game type (choices: fo4, tes5, sse)')

_game_path_arguments = _game_arguments.add_mutually_exclusive_group()
_game_path_arguments.add_argument('--game-path',
Expand Down
2 changes: 1 addition & 1 deletion pyro/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='Pyro',
description='A parallelized incremental build system for TESV, SSE, and FO4 projects',
description='A parallelized incremental build system for TES5, SSE, and FO4 projects',
author='fireundubh',
author_email='[email protected]',
license='MIT License',
Expand Down

0 comments on commit af3c53f

Please sign in to comment.