def create_copyright(self): args = {} args["upstream_name"] = self.name args["source"] = self.homepage args["upstream_date"] = self.date.year args["upstream_author"] = self.upstream_author args["upstream_contact"] = self.upstream_author if "bugs" in self.json and "url" in self.json["bugs"]: args["upstream_contact"] = self.json["bugs"]["url"] args["upstream_license_name"] = self.upstream_license if self.debian_license and self.upstream_license != self.debian_license: args["upstream_license"] = "\nLicense: %s" % utils.get_license(self.upstream_license) else: args["upstream_license"] = "" # do not insert same license twice args["debian_date"] = self.date.year args["debian_author"] = self.debian_author args["debian_license_name"] = self.debian_license args["debian_license"] = "License: %s" % utils.get_license(self.debian_license) template = utils.get_template("copyright") utils.create_debian_file("copyright", template % args)
def create_copyright(self): args = {} args['upstream_name'] = self.name args['source'] = self.homepage args['upstream_date'] = self.date.year args['upstream_author'] = self.upstream_author args['upstream_contact'] = self.upstream_author if 'bugs' in self.json and 'url' in self.json['bugs']: args['upstream_contact'] = self.json['bugs']['url'] args['upstream_license_name'] = self.upstream_license if self.debian_license and \ self.upstream_license != self.debian_license: args['upstream_license'] = "\nLicense: %s" % \ utils.get_license(self.upstream_license) else: args['upstream_license'] = '' # do not insert same license twice args['debian_date'] = self.date.year args['debian_author'] = self.debian_author args['debian_license_name'] = self.debian_license args['debian_license'] = "License: %s" % \ utils.get_license(self.debian_license) template = utils.get_template('copyright') utils.create_debian_file('copyright', template % args)
def print_license(args, prefix=""): if args.list: print("%s Available licenses are: %s." % \ (prefix, ', '.join(sorted(templates.LICENSES.keys())).lower())) else: if args.name is None: print("You have to specify a license name") args.list = True print_license(args) else: template_license = utils.get_license(args.name) if not template_license.startswith('FIX_ME'): print(template_license) else: print("Wrong license name.") args.list = True print_license(args)