def importpath2pkgname(self, importpath): # TODO: maybe use some sort of cache of importpath -> packagename ip = ImportPath(importpath) if not ip.parse(): return "" return ip.getPackageName()
def testPackageName(self): name = self.sp_obj.getTag('name') url = self.sp_obj.getTag('url') if name == "": self.t_result = "E: Missing name tag" self.err_number += 1 return False if url == "": self.t_result = "E: Missing url tag" self.err_number += 1 return False ip_obj = ImportPath(url) if not ip_obj.parse(): self.err = ip_obj.getError() return False pkg_name = ip_obj.getPackageName() if pkg_name == '': self.t_result = "E: Uknown repo url" self.err_number += 1 return False if pkg_name != name: self.t_result = "W: Incorrect package name %s, should be %s" % ( name, pkg_name) self.warn_number += 1 return False self.t_result = "I: Package name correct" return True
def testPackageName(self): name = self.sp_obj.getTag('name') url = self.sp_obj.getTag('url') if name == "": self.t_result = "E: Missing name tag" self.err_number += 1 return False if url == "": self.t_result = "E: Missing url tag" self.err_number += 1 return False ip_obj = ImportPath(url) if not ip_obj.parse(): self.err = ip_obj.getError() return False pkg_name = ip_obj.getPackageName() if pkg_name == '': self.t_result = "E: Uknown repo url" self.err_number += 1 return False if pkg_name != name: self.t_result = "W: Incorrect package name %s, should be %s" % (name, pkg_name) self.warn_number += 1 return False self.t_result = "I: Package name correct" return True