#!/usr/bin/env python3

import itertools
import operator
import os
import sys

DOCS_PATH = os.path.dirname(os.path.abspath(__file__))

from init import db
from horizons.constants import BUILDINGS, TIER, UNITS
from horizons.entities import Entities
from horizons.util.loaders.actionsetloader import ActionSetLoader

ActionSetLoader._find_action_sets('content/')

settler_names = dict(db('SELECT level, name FROM tier'))
unit_sets = dict((u.id, u.action_sets) for u in Entities.units.values())
SHIP_THUMBNAIL = 'content/gui/icons/units/thumbnails/{type_id}.png'
RES_PATH = 'content/gui/icons/resources/32/{id:03d}.png'

global gh, used_res_ids
gh = 'https://github.com/unknown-horizons/unknown-horizons/raw/master/'
#gh = 'file://localhost/{path}/'.format(path=os.path.abspath(sys.argv[1]))
used_res_ids = set()
footer = set()

header = """
Buildings Overview
==================
示例#2
0
import itertools
import operator
import os
import sys

DOCS_PATH = os.path.dirname(os.path.abspath(__file__))

from init import db
from horizons.constants import BUILDINGS, TIER, UNITS
from horizons.entities import Entities
from horizons.util.loaders.actionsetloader import ActionSetLoader

ActionSetLoader._find_action_sets("content/")

settler_names = dict(db("SELECT level, name FROM tier"))
unit_sets = dict((u.id, u.action_sets) for u in Entities.units.itervalues())
SHIP_THUMBNAIL = "content/gui/icons/units/thumbnails/{type_id}.png"
RES_PATH = "content/gui/icons/resources/32/{id:03d}.png"

global gh, used_res_ids
gh = "https://github.com/unknown-horizons/unknown-horizons/raw/master/"
# gh = 'file://localhost/{path}/'.format(path=os.path.abspath(sys.argv[1]))
used_res_ids = set()
footer = set()

header = """
Buildings Overview
==================

""".lstrip()