This commit is contained in:
Julien Palard 2023-03-13 15:50:21 +01:00
parent a06e02d00e
commit 7fa84874bc
Signed by: mdk
GPG Key ID: 0EFC1AC1006886F8
2 changed files with 6 additions and 6 deletions

View File

@ -4,7 +4,7 @@ import os
import pickle
from pathlib import Path
from tempfile import NamedTemporaryFile
from typing import Any, Callable, Dict, List, Optional, Sequence, cast, Set
from typing import Any, Callable, Dict, List, Optional, Sequence, Set, cast
import polib
@ -29,12 +29,12 @@ class PoFileStats:
self.reserved_by: Optional[str] = None
self.reservation_date: Optional[str] = None
self.filename_dir: str = self.directory + "/" + self.filename
self.stats: Dict[str, Any] = {}
self.stats: Dict[str, int] = {}
def __eq__(self, other: object) -> bool:
return isinstance(other, type(self)) and self.path == other.path
def __hash__(self):
def __hash__(self) -> int:
return hash(("PoFileStats", self.path))
@property
@ -76,7 +76,7 @@ class PoFileStats:
"translated": len(pofile.translated_entries()),
}
def __repr__(self):
def __repr__(self) -> str:
if self.stats:
return f"<PoFileStats {self.path!r} {self.entries} entries>"
return f"<PoFileStats {self.path!r} (unparsed)>"
@ -117,7 +117,7 @@ class PoDirectoryStats:
self.path = path
self.files_stats = files_stats
def __repr__(self):
def __repr__(self) -> str:
return f"<PoDirectoryStats {self.path!r} with {len(self.files_stats)} files>"
@property

View File

@ -1,7 +1,7 @@
import json
import logging
from pathlib import Path
from typing import Any, Callable, Dict, List
from typing import Callable, List
from gitignore_parser import rule_from_pattern