예제 #1
0
conf_path = '/etc/skylines/production.ini'
if len(sys.argv) > 2:
    conf_path = sys.argv[1]
    del sys.argv[1]

if len(sys.argv) != 3:
    print >>sys.stderr, "Usage: %s [config.ini] airspace_list.txt airspace_blacklist.txt" % sys.argv[0]
    sys.exit(1)

airspace_list = sys.argv[1]
airspace_blacklist = sys.argv[2]
blacklist = dict()

conf = appconfig('config:' + os.path.abspath(conf_path))
load_environment(conf.global_conf, conf.local_conf)


def main():
    # the lines in airspace_list contain the following:
    # de openair http://www.daec.de/download/ASDF.txt # for openair files
    # at sua http://www.austrocontrol.at/download/ASDF.sua # for SUA files

    airspace_re = re.compile(r'^([^#]{1}.*?)\s+(openair|sua)\s+(http://.*)')

    # import airspace blacklist to remove unwanted airspaces (e.g. borderlines)
    # each line contains the country code and the airspace name to remove
    # see provided file for example
    airspace_blacklist_re = re.compile(r'^([^#]{1}.*?)\s+(.*)')

    with open(airspace_blacklist, "r") as f:
예제 #2
0
def setup_app(command, conf, vars):
    """Place any commands to setup skylines here"""
    load_environment(conf.global_conf, conf.local_conf)
    setup_schema(command, conf, vars)
    bootstrap.bootstrap(command, conf, vars)