orgmunge 0.2.2__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {orgmunge-0.2.2 → orgmunge-0.2.3}/PKG-INFO +1 -1
- {orgmunge-0.2.2 → orgmunge-0.2.3}/pyproject.toml +1 -1
- {orgmunge-0.2.2 → orgmunge-0.2.3}/src/orgmunge/classes.py +22 -1
- orgmunge-0.2.3/src/orgmunge/parser.out +1970 -0
- {orgmunge-0.2.2 → orgmunge-0.2.3}/src/orgmunge/parser.py +2 -0
- orgmunge-0.2.3/src/orgmunge/parsetab.py +110 -0
- orgmunge-0.2.2/src/orgmunge/parser.out +0 -1912
- orgmunge-0.2.2/src/orgmunge/parsetab.py +0 -108
- {orgmunge-0.2.2 → orgmunge-0.2.3}/LICENSE +0 -0
- {orgmunge-0.2.2 → orgmunge-0.2.3}/README.org +0 -0
- {orgmunge-0.2.2 → orgmunge-0.2.3}/src/orgmunge/Untitled Document +0 -0
- {orgmunge-0.2.2 → orgmunge-0.2.3}/src/orgmunge/__init__.py +0 -0
- {orgmunge-0.2.2 → orgmunge-0.2.3}/src/orgmunge/lexer.py +0 -0
- {orgmunge-0.2.2 → orgmunge-0.2.3}/src/orgmunge/todos.json +0 -0
|
@@ -510,6 +510,17 @@ class Clocking:
|
|
|
510
510
|
def duration(self, _):
|
|
511
511
|
raise TypeError("Can't set the duration for a clocking object! Set the start and/or end time instead.")
|
|
512
512
|
|
|
513
|
+
@property
|
|
514
|
+
def duration_seconds(self):
|
|
515
|
+
if self.end_time is None:
|
|
516
|
+
return (dt.now() - self.start_time).seconds
|
|
517
|
+
else:
|
|
518
|
+
return (self.end_time - self.start_time).seconds
|
|
519
|
+
|
|
520
|
+
@duration_seconds.setter
|
|
521
|
+
def duration_seconds(self, _):
|
|
522
|
+
raise TypeError("Can't set the duration for a clocking object! Set the start and/or end time instead.")
|
|
523
|
+
|
|
513
524
|
def __repr__(self):
|
|
514
525
|
if self.end_time is None:
|
|
515
526
|
return f'[{self.start_time.strftime(ORG_TIME_FORMAT)}]'
|
|
@@ -521,7 +532,10 @@ class Clocking:
|
|
|
521
532
|
return False
|
|
522
533
|
else:
|
|
523
534
|
return str(self) == str(other)
|
|
524
|
-
|
|
535
|
+
|
|
536
|
+
def __lt__(self, other):
|
|
537
|
+
return
|
|
538
|
+
class Heading:
|
|
525
539
|
def __init__(self, headline: Headline, contents: Tuple[Scheduling, List[Drawer], str]):
|
|
526
540
|
self._headline = headline
|
|
527
541
|
self._scheduling, self._drawers, self.body = contents
|
|
@@ -804,6 +818,13 @@ class Heading():
|
|
|
804
818
|
for child in children:
|
|
805
819
|
child.demote_tree()
|
|
806
820
|
|
|
821
|
+
def get_path(self):
|
|
822
|
+
"Returns the full path of the current heading as a list of headings"
|
|
823
|
+
if self.parent.title == 'ROOT':
|
|
824
|
+
return [self]
|
|
825
|
+
else:
|
|
826
|
+
return self.parent.get_path() + [self]
|
|
827
|
+
|
|
807
828
|
def __repr__(self):
|
|
808
829
|
scheduling = str(self.scheduling) + "\n" if self.scheduling else ""
|
|
809
830
|
drawers = "".join(d.__str__() for d in self.drawers) if self.drawers else ""
|