From 872648acf20b0b233866f84cc8dedcc03051af85 Mon Sep 17 00:00:00 2001 From: Jan Berges Date: Sat, 16 Mar 2024 09:23:08 +0100 Subject: [PATCH] Fix entry points This fix has also been included in slackline's commit "Fixing entry points", see pull request #10 by ns-rse. --- igor2/cli/igorbinarywave.py | 7 +++++-- igor2/cli/igorpackedexperiment.py | 9 ++++++--- pyproject.toml | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) 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"]