Closed Cube707 closed 1 year ago
@gijzelaerr could you take a look at this?
Implemented the changes.
Current behavior:
Usage: python -m snap7.server [OPTIONS]
# or
Usage: snap7-server [OPTIONS]
Start a S7 dummy server with some default values.
Options:
-p, --port INTEGER Port the server will listen on.
-v, --verbose Also print debug-output.
--version Show the version and exit.
-h, --help Show this message and exit.
[Hidden option: ]
--dll PATH
I now fully removed the old script. It would cause name-collisions with the new entry-point. The new entry-point is a drop-in replacement. Only preople who provieded a first argument (the path to the dll) to the old script will get an Error: Got unexpected extra argument (foo)
there seems to be a conflict with master.
rebased, should merge now
@gijzelaerr should be ready
i think i've fixed master, if you merge master into your branch the build should work
@gijzelaerr I rebase onto the new state of master and now all tests pass. Great work fixing the workflows
This PR implements entripoints via
__main__.py
files, which closes #407. This can replace the existingbin/snap7-server.py
script and offer a much more pythonic way to achive the same.Currently implemented:
Diskussion
There are still a few question I feel should be discussed:
snap7-server
binary on install?python -m snap7.client
could be implemented in the future as well. This could be a simple CLI offering terminal acces to some basic versions of the functions this project provides. (for example:snap7.client db-read 0 --start 120 --size 1
, etc...)click
acceptable as a dependency. This makes extending the CLI much simpler (espacially ifsnap7.client
will be implementd). But the current, simple behaviour could be implemented without this dependency.bin/snap7-server.py
be removed right now or keep around for backwards compatibily?server.mainloop
andserver._init_standard_values
functions fit much better into the__main__.py
file, but this would break the API, so is probably not desirable. We could however move the implmentaion and import them back intoserver
if that is acceptablesnap7.server
should have?Ideas:
--version
--verbose/-v
tests are not working right now...
keeping this a draft untill discussion is done