Skip to content

fast forward examples commit #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,9 @@ Here one can see the use of `instance_name` and why it turns up in the URL path.

##### NOTE - The package is under active development. Contributors welcome, please check CONTRIBUTING.md and the open issues. Some issues can also be independently dealt without much knowledge of this package.

- [example repository](https://github.com/VigneshVSV/hololinked-examples) - detailed examples for both clients and servers
- [helper GUI](https://github.com/VigneshVSV/thing-control-panel) - view & interact with your object's actions, properties and events.
- [examples repository](https://github.com/hololinked-dev/examples) - detailed examples for both clients and servers
- [helper GUI](https://github.com/hololinked-dev/thing-control-panel) - view & interact with your object's actions, properties and events.
- [live demo](https://control-panel.hololinked.dev/#https://examples.hololinked.dev/simulations/oscilloscope/resources/wot-td) - an example of an oscilloscope available for live test

See a list of currently supported possibilities while using this package [below](#currently-supported).

Expand Down Expand Up @@ -337,13 +338,9 @@ If there are errors in generation of Thing Description

Again, please check examples or the code for explanations. Documentation is being activety improved.

### Currently being worked

- unit tests coverage
- separation of HTTP protocol specification like URL path and HTTP verbs from the API of properties, actions and events and move their customization completely to the HTTP server
- serve multiple things with the same server (unfortunately due to a small oversight it is currently somewhat difficult for end user to serve multiple things with the same server, although its possible. This will be fixed.)
- improving accuracy of Thing Descriptions
- cookie credentials for authentication - as a workaround until credentials are supported, use `allowed_clients` argument on HTTP server which restricts access based on remote IP supplied with the HTTP headers. This wont still help you in public networks or modified/non-standard HTTP clients.


### Contributing

See [organization info](https://github.com/hololinked-dev) for details regarding contributing to this package. There is:
- discord group - [![Discord](https://img.shields.io/discord/1265289049783140464?label=Discord%20Members&logo=discord)](https://discord.com/invite/kEz87zqQXh)
- [weekly meetings](https://github.com/hololinked-dev/#monthly-meetings) and
- [project planning](https://github.com/orgs/hololinked-dev/projects/4) to discuss activities around this repository.
2 changes: 1 addition & 1 deletion doc
Submodule doc updated from c0c4a8 to d4e965
2 changes: 1 addition & 1 deletion examples
15 changes: 11 additions & 4 deletions hololinked/param/parameterized.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,10 @@ def __set__(self, obj : typing.Union['Parameterized', typing.Any], value : typin
raise_ValueError("Read-only parameter cannot be set/modified.", self)

value = self.validate_and_adapt(value)

if self.class_member and obj is not self.owner: # safety check

if not self.class_member and obj is self.owner:
raise AttributeError("Cannot set instance parameter on class")
if self.class_member and obj is not self.owner:
obj = self.owner

old = NotImplemented
Expand Down Expand Up @@ -1807,8 +1809,13 @@ def __setattr__(mcs, attribute_name : str, value : typing.Any) -> None:
if attribute_name != '_param_container' and attribute_name != '__%s_params__' % mcs.__name__:
parameter = mcs.parameters.descriptors.get(attribute_name, None)
if parameter: # and not isinstance(value, Parameter):
parameter.__set__(mcs, value)
return
try:
parameter.__set__(mcs, value)
return
except AttributeError as ex:
# raised for class attribute
if not str(ex).startswith("Cannot set instance parameter on class"):
raise ex from None
return type.__setattr__(mcs, attribute_name, value)

def __getattr__(mcs, attribute_name : str) -> typing.Any:
Expand Down