5e724407068a57c69a952c2c15e1ae1b2e502ba5
[nepi.git] / src / nepi / util / tags.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 MOBILE = "mobile"
5 NODE = "node"
6 INTERFACE = "interface"
7 WIRELESS = "wireless"
8 APPLICATION = "application"
9 NAT = "nat"
10 SWITCH = "switch"
11 PPP = "point-to-point"
12 PROTOCOL = "protocol"
13 TUNNEL = "tunnel"
14 INTERNET = "internet"
15 HUB = "hub"
16 ALLOW_ADDRESSES = "allow_addresses"
17 ALLOW_ROUTES = "allow_routes"
18 HAS_ADDRESSES = "has_addresses"
19 HAS_ROUTES = "has_routes"
20
21 class Taggable(object):
22     def __init__(self):
23         super(Taggable, self).__init__()
24         self._tags = list()
25
26     @property
27     def tags(self):
28         return self._tags
29
30     def add_tag(self, tag_id):
31         self._tags.append(tag_id)
32
33     def has_tag(self, tag_id):
34         return tag_id in self._tags
35