Projekt

Obecné

Profil

« Předchozí | Další » 

Revize af7609b5

Přidáno uživatelem Tomáš Ballák před více než 3 roky(ů)

Re #8193 - refactoring crawler

Zobrazit rozdíly:

modules/crawler/Utilities/Database/database_data_line.py
1
from typing import Dict
2

  
3

  
1 4
class DatabaseDataLine:
2 5
    """
3 6
    Class that specifies the look of data line in database
4 7
    """
5
    def __init__(self, name, longitude, latitude, date, occurrence):
8
    def __init__(self, name: str, longitude: float, latitude: float, date: str,
9
                 occurrence: int):
6 10
        self.name = name
7 11
        self.latitude = latitude
8 12
        self.longitude = longitude
9 13
        self.date = date
10 14
        self.occurrence = occurrence
11 15

  
12
    def to_dictionary(self):
13
        return {"place": self.name, "x": self.longitude, "y": self.latitude, "number": self.occurrence,
14
                "date": self.date}
16
    def to_dictionary(self) -> Dict[str, any]:
17
        return {
18
            "place": self.name,
19
            "x": self.longitude,
20
            "y": self.latitude,
21
            "number": self.occurrence,
22
            "date": self.date
23
        }

Také k dispozici: Unified diff