# Path: db/common/route_types.py
# class Network(Enum):
#     """ Basic types of network levels.
#     """
#     LOC = 0
#     REG = 1
#     NAT = 2
#     INT = 3
# 
#     def __call__(self, importance=0):
#         if abs(importance) > 3:
#             raise Runtime_error("Network importance must be between -3 and 3")
#         return 7 * self.value + 3 + importance
# 
#     def max(self):
#         return self.__call__(3)
# 
#     def min(self):
#         return self.__call__(-3)
# 
#     @staticmethod
#     def from_int(i):
#         if i <= Network.LOC.max():
#             return Network.LOC
#         if i <= Network.REG.max():
#             return Network.REG
#         if i <= Network.NAT.max():
#             return Network.NAT
#         if i <= Network.INT.max():
#             return Network.INT
#         raise ValueError("Integer out of range for Network")


from db.common.route_types import Network
                  'sleigh'        : 6,
                  # unknown value : 0
                 }

class GuidePostConfig:
    table_name = 'guideposts'
    node_subset = 'tags @> \'{ "tourism" : "information", "information": "guidepost"}\'::jsonb'
    subtype = None
    require_subtype = False


class NetworkNodeConfig:
    table_name = 'networknodes'
    node_tag = 'ref'


class ShieldConfiguration(object):
    symbol_outdir = None
    symbol_dir = 'maps/symbols'

    image_size = (15, 15)
    wide_image_size = (22, 15)
    image_border_width = 2.5

    text_border_width = 2.5
    text_bgcolor = (1, 1, 1) # white
    text_color = (0, 0, 0) # black
    text_font = "DejaVu-Sans Condensed Bold 7.5"

    level_colors = { Network.INT : (0.7, 0.01, 0.01),

# Path: db/common/route_types.py
# class Network(Enum):
#     """ Basic types of network levels.
#     """
#     LOC = 0
#     REG = 1
#     NAT = 2
#     INT = 3
# 
#     def __call__(self, importance=0):
#         if abs(importance) > 3:
#             raise Runtime_error("Network importance must be between -3 and 3")
#         return 7 * self.value + 3 + importance
# 
#     def max(self):
#         return self.__call__(3)
# 
#     def min(self):
#         return self.__call__(-3)
# 
#     @staticmethod
#     def from_int(i):
#         if i <= Network.LOC.max():
#             return Network.LOC
#         if i <= Network.REG.max():
#             return Network.REG
#         if i <= Network.NAT.max():
#             return Network.NAT
#         if i <= Network.INT.max():
#             return Network.INT
#         raise ValueError("Integer out of range for Network")


# Path: db/configs.py
from db.common.route_types import Network

                  'sleigh'        : 6,
                  # unknown value : 0
                 }

class GuidePostConfig:
    table_name = 'guideposts'
    node_subset = 'tags @> \'{ "tourism" : "information", "information": "guidepost"}\'::jsonb'
    subtype = None
    require_subtype = False


class NetworkNodeConfig:
    table_name = 'networknodes'
    node_tag = 'ref'


class ShieldConfiguration(object):
    symbol_outdir = None
    symbol_dir = 'maps/symbols'

    image_size = (15, 15)
    wide_image_size = (22, 15)
    image_border_width = 2.5

    text_border_width = 2.5
    text_bgcolor = (1, 1, 1) # white
    text_color = (0, 0, 0) # black
    text_font = "DejaVu-Sans Condensed Bold 7.5"

    level_colors = { Network.INT : (0.7, 0.01, 0.01),

                     Network.NAT : (0.08, 0.18, 0.92),