Selfie
Loading...
Searching...
No Matches
selfie_lib.WriteTracker.CallLocation Class Reference
Inheritance diagram for selfie_lib.WriteTracker.CallLocation:
selfie_lib.WriteTracker.InlineWriteTracker

Public Member Functions

 __init__ (self, Optional[str] file_name, int line)
 
Optional[str] file_name (self)
 
int line (self)
 
"CallLocation" with_line (self, int line)
 
str ide_link (self, "SnapshotFileLayout" _)
 
bool same_path_as (self, "CallLocation" other)
 
str source_filename_without_extension (self)
 
bool __lt__ (self, other)
 
bool __eq__ (self, other)
 
 __hash__ (self)
 

Protected Attributes

 _file_name
 
 _line
 

Detailed Description

Definition at line 19 of file WriteTracker.py.

Constructor & Destructor Documentation

◆ __init__()

selfie_lib.WriteTracker.CallLocation.__init__ (   self,
Optional[str]  file_name,
int  line 
)

Definition at line 20 of file WriteTracker.py.

20 def __init__(self, file_name: Optional[str], line: int):
21 self._file_name = file_name
22 self._line = line
23

Member Function Documentation

◆ __eq__()

bool selfie_lib.WriteTracker.CallLocation.__eq__ (   self,
  other 
)

Definition at line 53 of file WriteTracker.py.

53 def __eq__(self, other) -> bool:
54 if not isinstance(other, CallLocation):
55 return NotImplemented
56 return (self._file_name, self._line) == (other.file_name, other.line)
57

◆ __hash__()

selfie_lib.WriteTracker.CallLocation.__hash__ (   self)

Definition at line 58 of file WriteTracker.py.

58 def __hash__(self):
59 return hash((self._file_name, self._line))
60
61

◆ __lt__()

bool selfie_lib.WriteTracker.CallLocation.__lt__ (   self,
  other 
)

Definition at line 48 of file WriteTracker.py.

48 def __lt__(self, other) -> bool:
49 if not isinstance(other, CallLocation):
50 return NotImplemented
51 return (self._file_name, self._line) < (other.file_name, other.line)
52

◆ file_name()

Optional[str] selfie_lib.WriteTracker.CallLocation.file_name (   self)

Definition at line 25 of file WriteTracker.py.

25 def file_name(self) -> Optional[str]:
26 return self._file_name
27

◆ ide_link()

str selfie_lib.WriteTracker.CallLocation.ide_link (   self,
"SnapshotFileLayout"  _ 
)

Definition at line 35 of file WriteTracker.py.

35 def ide_link(self, _: "SnapshotFileLayout") -> str:
36 return f"File: {self._file_name}, Line: {self._line}"
37

◆ line()

int selfie_lib.WriteTracker.CallLocation.line (   self)

Definition at line 29 of file WriteTracker.py.

29 def line(self) -> int:
30 return self._line
31

◆ same_path_as()

bool selfie_lib.WriteTracker.CallLocation.same_path_as (   self,
"CallLocation"  other 
)

Definition at line 38 of file WriteTracker.py.

38 def same_path_as(self, other: "CallLocation") -> bool:
39 if not isinstance(other, CallLocation):
40 return False
41 return self._file_name == other.file_name
42

◆ source_filename_without_extension()

str selfie_lib.WriteTracker.CallLocation.source_filename_without_extension (   self)

Definition at line 43 of file WriteTracker.py.

43 def source_filename_without_extension(self) -> str:
44 if self._file_name is not None:
45 return self._file_name.rsplit(".", 1)[0]
46 return ""
47

◆ with_line()

"CallLocation" selfie_lib.WriteTracker.CallLocation.with_line (   self,
int  line 
)

Definition at line 32 of file WriteTracker.py.

32 def with_line(self, line: int) -> "CallLocation":
33 return CallLocation(self._file_name, line)
34

Member Data Documentation

◆ _file_name

selfie_lib.WriteTracker.CallLocation._file_name
protected

Definition at line 21 of file WriteTracker.py.

◆ _line

selfie_lib.WriteTracker.CallLocation._line
protected

Definition at line 22 of file WriteTracker.py.


The documentation for this class was generated from the following file: