| 148 | |
| 149 | @attr.s(frozen=True) |
| 150 | class DistMetadataFile(object): |
| 151 | type = attr.ib() # type: MetadataType.Value |
| 152 | location = attr.ib() # type: Text |
| 153 | rel_path = attr.ib() # type: Text |
| 154 | project_name = attr.ib() # type: ProjectName |
| 155 | version = attr.ib() # type: Version |
| 156 | pkg_info = attr.ib(eq=False) # type: Message |
| 157 | |
| 158 | def render_metadata_file_description(self, metadata_file_rel_path): |
| 159 | # type: (Text) -> str |
| 160 | return "{project_name} {version} metadata from {rel_path} at {location}".format( |
| 161 | project_name=self.project_name, |
| 162 | version=self.version, |
| 163 | rel_path=metadata_file_rel_path, |
| 164 | location=self.location, |
| 165 | ) |
| 166 | |
| 167 | def render_description(self): |
| 168 | # type: () -> str |
| 169 | return self.render_metadata_file_description(self.rel_path) |
| 170 | |
| 171 | @property |
| 172 | def path(self): |
| 173 | # type: () -> Text |
| 174 | return os.path.join(self.location, self.rel_path) |
| 175 | |
| 176 | |
| 177 | @attr.s(frozen=True) |
no outgoing calls
no test coverage detected