source: geniuswebcore/geniusweb/references/ProtocolRef.py@ 74

Last change on this file since 74 was 73, checked in by Bart Vastenhouw, 3 years ago

Fix for IssueValue hashcode.

File size: 992 bytes
Line 
1from pyson.JsonGetter import JsonGetter
2from pyson.JsonValue import JsonValue
3from uri.uri import URI # type: ignore
4
5from geniusweb.references.Reference import Reference
6
7
8class ProtocolRef (Reference):
9 '''
10 A URI reference to get a copy of a profile. This usually is a "ws://"
11 (websocket) URI, allowing users (parties) to get notifications if the profile
12 is changed.
13 <p>
14 In debugging scenarios, this is usually a "file://" URI, in which case the
15 profile is assumed to be static during the run. Parties that support
16 debugging eg with the simplerunner should support the file: protocol.
17 '''
18
19 def __init__(self, uri:URI):
20 assert isinstance(uri, URI)
21 self._protocol = uri
22
23 @JsonValue()
24 def getURI(self) -> URI :
25 return self._protocol
26
27 def __repr__(self):
28 return "ProtocolRef[" + str(self._protocol) + "]"
29
30 def __eq__(self, other):
31 return isinstance(other, self.__class__) and \
32 self._protocol==other._protocol
33
34 def __hash__(self):
35 return hash(str(self._protocol))
Note: See TracBrowser for help on using the repository browser.