diff --git a/igor2/cli/igorbinarywave.py b/igor2/cli/igorbinarywave.py index 61c5c2b..adcdedd 100755 --- a/igor2/cli/igorbinarywave.py +++ b/igor2/cli/igorbinarywave.py @@ -19,6 +19,9 @@ def _run(self, args): wave['wave'].pop('wData') pprint.pprint(wave) +def main(): + s = WaveScript(description=__doc__) + s.run() -s = WaveScript(description=__doc__) -s.run() +if __name__ == '__main__': + main() diff --git a/igor2/cli/igorpackedexperiment.py b/igor2/cli/igorpackedexperiment.py index 89de1b5..6aa240a 100755 --- a/igor2/cli/igorpackedexperiment.py +++ b/igor2/cli/igorpackedexperiment.py @@ -48,7 +48,10 @@ def _plot_wave_callback(self, dirpath, key, value): if isinstance(value, WaveRecord): self.plot_wave(self.args, value.wave, title=dirpath + [key]) +def main(): + s = PackedScript( + description=__doc__, filetype='IGOR Packed Experiment (.pxp) file') + s.run() -s = PackedScript( - description=__doc__, filetype='IGOR Packed Experiment (.pxp) file') -s.run() +if __name__ == '__main__': + main() diff --git a/pyproject.toml b/pyproject.toml index d2b7bb1..6f39ef6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,8 +33,8 @@ CLI = [ ] [project.scripts] -igorbinarywave = 'igor2.cli:igorbinarywave' -igorpackedexperiment = 'igor2.cli:igorpackedexperiment' +igorbinarywave = 'igor2.cli.igorbinarywave:main' +igorpackedexperiment = 'igor2.cli.igorpackedexperiment:main' [tool.setuptools] packages = ["igor2"]