Skip to content

Commit

Permalink
try using Protocol for my.whatsapp.android
Browse files Browse the repository at this point in the history
  • Loading branch information
karlicoss committed Aug 22, 2024
1 parent 675bb66 commit 0e0ab5f
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions my/whatsapp/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
"""
from __future__ import annotations

from abc import abstractmethod
from dataclasses import dataclass
from datetime import datetime, timezone
from pathlib import Path
import sqlite3
from typing import Union, Sequence, Iterator, Optional
from typing import Union, Sequence, Iterator, Optional, Protocol

from my.core import get_files, Paths, datetime_aware, Res, make_logger
from my.core.common import unique_everseen
Expand All @@ -20,16 +19,11 @@
logger = make_logger(__name__)


class Config:
class Config(Protocol):
# paths[s]/glob to the exported sqlite databases
@property
@abstractmethod
def export_path(self) -> Paths:
raise NotImplementedError

@property
def my_user_id(self) -> Optional[str]:
return None
export_path: Paths

my_user_id: Optional[str] = None


def make_config() -> Config:
Expand Down

0 comments on commit 0e0ab5f

Please sign in to comment.