leaf_focus/download/crawl/item.py
def save(cls, path: Path, items: List["Item"]):
        """Save file items to a file."""
        fields = ["category", "last_updated", "name", "path", "referrer", "url"]
        with open(path, "wt", newline="", encoding="utf8") as f:
            writer = csv.DictWriter(f, fields)
            writer.writeheader()
            for i in items:
                writer.writerow(
                    {
                        "name": i.name,
                        "category": i.category,
                        "path": i.path,
                        "url": i.url,
                        "referrer": i.referrer,
                        "last_updated": i.last_updated,
                    }
                )
Save file items to a file.
Save file items to a file.
Save file items to a file .
def save(cls, path: Path, items: List["Item"]):
        fields = ["category", "last_updated", "name", "path", "referrer", "url"]
        with open(path, "wt", newline="", encoding="utf8") as f:
            writer = csv.DictWriter(f, fields)
            writer.writeheader()
            for i in items:
                writer.writerow(
                    {
                        "name": i.name,
                        "category": i.category,
                        "path": i.path,
                        "url": i.url,
                        "referrer": i.referrer,
                        "last_updated": i.last_updated,
                    }
                )
def save ( cls , path : Path , items : List [ "Item" ] ) : fields = [ "category" , "last_updated" , "name" , "path" , "referrer" , "url" ] with open ( path , "wt" , newline = "" , encoding = "utf8" ) as f : writer = csv . DictWriter ( f , fields ) writer . writeheader ( ) for i in items : writer . writerow ( { "name" : i . name , "category" : i . category , "path" : i . path , "url" : i . url , "referrer" : i . referrer , "last_updated" : i . last_updated , } )
Save file items to a file.
Save file items to a file .
"""Save file items to a file."""
cls
path
Path
items
List["Item"]