Service scope implementation.
| 2 | |
| 3 | |
| 4 | class Scope: |
| 5 | "Service scope implementation." |
| 6 | |
| 7 | def __init__(self, value, matchBy=None): |
| 8 | self._matchBy = matchBy |
| 9 | self._value = value |
| 10 | |
| 11 | def getMatchBy(self): |
| 12 | return self._matchBy |
| 13 | |
| 14 | def getValue(self): |
| 15 | return self._value |
| 16 | |
| 17 | def getQuotedValue(self): |
| 18 | return self._value.replace(' ', '%20') |
| 19 | |
| 20 | def __repr__(self): |
| 21 | if self.getMatchBy() == None or len(self.getMatchBy()) == 0: |
| 22 | return self.getValue() |
| 23 | else: |
| 24 | return self.getMatchBy() + ":" + self.getValue() |
| 25 | |
| 26 |