Ejemplo n.º 1
0
 def auto_fill_entry_points(self, key="entry_points"):
     if self.pkg_info.entry_points_txt:
         self.add_definition(key,
                             load_contents(self.pkg_info.entry_points_txt),
                             relative_path(self.pkg_info.entry_points_txt))
     path = "%s.ini" % key
     self.add_definition(key, load_contents(path), path)
Ejemplo n.º 2
0
    def __init__(self, root):
        self.path = os.path.join(root, "PKG-INFO")
        self.info = {}
        self.name = None
        self.dependency_links_txt = None
        self.entry_points_txt = None
        self.requires_txt = None
        lines = load_contents(self.path)
        if not lines:
            return

        # Parse PKG-INFO when present
        line_number = 0
        key = None
        for line in lines.split("\n"):
            line_number += 1
            if line.startswith(" "):
                self.info[key].append(line[8:])
                continue

            if ": " in line:
                key, _, value = line.partition(": ")
                key = self.canonical_key(key)
                if key is None:
                    continue
                if key in self._list_types:
                    if key not in self.info:
                        self.info[key] = []
                    self.info[key].append(value)

                else:
                    self.info[key] = value

                continue

            setupmeta.trace("Unknown format line %s in %s: %s" %
                            (line_number, self.path, line))

        self.name = self.info.get("name")
        self.pythonified_name = pythonified_name(self.name)
        self.info["long_description"] = "\n".join(
            self.info.get("long_description", []))
        self.load_more_info(root)
Ejemplo n.º 3
0
 def expected_contents(self):
     content = load_contents(self.expected_path())
     return content and content.strip()
Ejemplo n.º 4
0
 def auto_fill_entry_points(self, key='entry_points'):
     path = "%s.ini" % key
     value = load_contents(path)
     if value:
         self.add_definition(key, value, path)
Ejemplo n.º 5
0
 def auto_fill_entry_points(self, key="entry_points"):
     path = "%s.ini" % key
     self.add_definition(key, load_contents(path), path)