From: Michael Tremer Date: Sun, 17 Jun 2018 14:13:59 +0000 (+0100) Subject: Set database vendor X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f41a0f40756812e5b04706a6c6228f8aa6793883;p=location%2Flocation-database.git Set database vendor Signed-off-by: Michael Tremer --- diff --git a/compile-database b/compile-database index f225186..01c12e8 100755 --- a/compile-database +++ b/compile-database @@ -30,7 +30,7 @@ if not len(sys.argv) > 1: path = sys.argv[1] -database = tools.Database() +database = tools.Database(vendor="IPFire Project") for RIR in tools.RIRS: rir = RIR() diff --git a/tools/database.py b/tools/database.py index 99d6918..8ad61c5 100644 --- a/tools/database.py +++ b/tools/database.py @@ -30,10 +30,18 @@ from . import util RE_AS = re.compile("^AS(\d+)$") class Database(object): - def __init__(self): + def __init__(self, vendor, description=None, license=None): self.writer = location.Writer() - # XXX must set vendor, license and description + # Set metadata + if vendor: + self.writer.vendor = vendor + + if description: + self.writer.description = description + + if license: + self.writer.license = license def write(self, path): self.writer.write(path)