Changeset View
Changeset View
Standalone View
Standalone View
swh/model/model.py
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | def from_dict(cls, d): | ||||
timestamp=Timestamp.from_dict(d['timestamp']), | timestamp=Timestamp.from_dict(d['timestamp']), | ||||
offset=d['offset'], | offset=d['offset'], | ||||
negative_utc=d['negative_utc']) | negative_utc=d['negative_utc']) | ||||
@attr.s | @attr.s | ||||
class Origin(BaseModel): | class Origin(BaseModel): | ||||
"""Represents a software source: a VCS and an URL.""" | """Represents a software source: a VCS and an URL.""" | ||||
type = attr.ib(type=str) | |||||
url = attr.ib(type=str) | url = attr.ib(type=str) | ||||
type = attr.ib(type=Optional[str], default=None) | |||||
@attr.s | @attr.s | ||||
class OriginVisit(BaseModel): | class OriginVisit(BaseModel): | ||||
"""Represents a visit of an origin at a given point in time, by a | """Represents a visit of an origin at a given point in time, by a | ||||
SWH loader.""" | SWH loader.""" | ||||
origin = attr.ib(type=Origin) | origin = attr.ib(type=Origin) | ||||
date = attr.ib(type=datetime.datetime) | date = attr.ib(type=datetime.datetime) | ||||
▲ Show 20 Lines • Show All 270 Lines • Show Last 20 Lines |