| 226 | |
| 227 | @classmethod |
| 228 | def get_node_urls(cls): |
| 229 | assert cls.node_type is not None, \ |
| 230 | "Please set the node_type for this class ({0})".format( |
| 231 | str(cls.__class__.__name__)) |
| 232 | common_url = '/' |
| 233 | for p in cls.parent_ids: |
| 234 | common_url += '<{0}:{1}>/'.format(str(p['type']), str(p['id'])) |
| 235 | |
| 236 | id_url = None |
| 237 | for p in cls.ids: |
| 238 | id_url = '{0}<{1}:{2}>'.format( |
| 239 | common_url if not id_url else id_url, |
| 240 | p['type'], p['id']) |
| 241 | |
| 242 | return id_url, common_url |
| 243 | |
| 244 | def __init__(self, **kwargs): |
| 245 | self.cmd = kwargs['cmd'] |