Skip to content

Commit

Permalink
start refactor: will change code, so metadat uses "dependencies" from…
Browse files Browse the repository at this point in the history
… now on
  • Loading branch information
wkta committed Sep 5, 2024
1 parent 6ec457e commit d2e6da2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/pyvcmdline/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def bump_subcommand(bundle_name):
"""
print('bump bundle to current version that is', __version__)
my_metadat = read_metadata(bundle_name)
my_metadat['vmlib_ver'] = __version__.replace('.', '_')
my_metadat['dependencies']['pyved_engine'] = [__version__.replace('.', '_'), 'pyv'] # alias = pyv
rewrite_metadata(bundle_name, my_metadat)


Expand Down
52 changes: 28 additions & 24 deletions src/pyvcmdline/cmdline_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,30 @@


EXP_METADAT_KEYS = (
'asset_base_folder',
'asset_list',
'sound_base_folder',
'sound_list',

'vmlib_ver',
'author',
'build_date',
'dependencies',
'description',
'title',
'instructions',
'slug',
'thumbnail512x384',
'thumbnail512x512',
'ktg_services',
'source_files',

'uses_challenge',
'has_game_server',
'ncr_faucet',
'game_genre'
)
'dependencies',
'asset_base_folder',
'asset_list',
'sound_base_folder',
'sound_list',

'vmlib_ver',
'author',
'build_date',
'dependencies',
'description',
'title',
'instructions',
'slug',
'thumbnail512x384',
'thumbnail512x512',
'ktg_services',
'source_files',

'uses_challenge',
'has_game_server',
'ncr_faucet',
'game_genre'
)

template_pyconnector_config_file ="""
{
Expand Down Expand Up @@ -58,6 +59,9 @@ def verify_metadata(mdat_obj) -> str:
for k in EXP_METADAT_KEYS:
if k not in mdat_obj:
return 'Missing key= {}'.format(k)
# need to test that pyved_engine is in dependencies...
if "pyved_engine" not in mdat_obj['dependencies']:
return 'Invalid list detected: "pyved_engine" not listed in the list of dependencies'

# we also need to test whether Y or N, categories specified are still recognized within the CMS!
if (not isinstance(mdat_obj['game_genre'], list)) or (len(mdat_obj['game_genre']) == 0):
Expand All @@ -66,7 +70,7 @@ def verify_metadata(mdat_obj) -> str:
for elt in mdat_obj['game_genre']:
if elt not in ok_game_genres:
return f'Game genre "{elt}" rejected by the Kata.Games system, please contact an Admin, or replace value'
print('--Metadata is valid--')
print('Metadata->OK')


def read_metadata(bundle_name):
Expand Down

0 comments on commit d2e6da2

Please sign in to comment.