Last change
on this file since 78 was 73, checked in by Bart Vastenhouw, 3 years ago |
Fix for IssueValue hashcode.
|
File size:
759 bytes
|
Rev | Line | |
---|
[73] | 1 | from pyson.JsonValue import JsonValue
|
---|
| 2 | from uri.uri import URI
|
---|
| 3 |
|
---|
| 4 | from geniusweb import party
|
---|
| 5 | from geniusweb.references.Reference import Reference
|
---|
| 6 |
|
---|
| 7 |
|
---|
| 8 | class PartyRef (Reference):
|
---|
| 9 | '''
|
---|
| 10 | A URI reference to create a new instance of a party on a party factory
|
---|
| 11 | server. These are used to describe sesion and tournament settings.
|
---|
| 12 | '''
|
---|
| 13 |
|
---|
| 14 |
|
---|
| 15 | def __init__(self, party:URI ):
|
---|
| 16 | if not isinstance(party, URI):
|
---|
| 17 | raise ValueError("expected URI, but got "+repr(party))
|
---|
| 18 | self._party = party
|
---|
| 19 |
|
---|
| 20 | @JsonValue()
|
---|
| 21 | def getURI(self)-> URI :
|
---|
| 22 | return self._party;
|
---|
| 23 |
|
---|
| 24 | def __repr__(self) ->str:
|
---|
| 25 | return "PartyRef[" + str(self._party) + "]"
|
---|
| 26 |
|
---|
| 27 |
|
---|
| 28 | def __eq__(self, other):
|
---|
| 29 | return isinstance(other, self.__class__) and self._party==other._party
|
---|
| 30 |
|
---|
| 31 | def __hash__(self):
|
---|
| 32 | return hash(self._party)
|
---|
Note:
See
TracBrowser
for help on using the repository browser.