# HG changeset patch # User Emmanuel Gil Peyrot # Date 1341418137 -7200 # Node ID 65453340ae950aadf84ecaa2ea832c6e5aa7c125 # Parent bc162f60f0a0d467d1512d3275b2b406e3285964 Print an error when all the needed files aren’t present. diff --git a/eosd b/eosd --- a/eosd +++ b/eosd @@ -15,6 +15,7 @@ import argparse import os +import sys import pyximport pyximport.install() @@ -51,7 +52,12 @@ class EoSDGameBossRush(EoSDGame): def main(path, data, stage_num, rank, character, replay, boss_rush, fps_limit, single_buffer): resource_loader = Loader(path) - resource_loader.scan_archives(data) + + try: + resource_loader.scan_archives(data) + except IOError: + sys.stderr.write('Some data files were not found, did you forget the -p option?\n') + exit(1) if stage_num is None: story = True diff --git a/pytouhou/resource/loader.py b/pytouhou/resource/loader.py --- a/pytouhou/resource/loader.py +++ b/pytouhou/resource/loader.py @@ -120,6 +120,8 @@ class Loader(object): path = os.path.join(self.game_dir, path) yield glob(path) paths = list(chain(*_expand_paths())) + if not paths: + raise IOError path = paths[0] if os.path.splitext(path)[1] == '.exe': self.exe_files.extend(paths)