orgmunge 0.2.2__tar.gz → 0.2.4__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.4}/PKG-INFO +2 -1
- {orgmunge-0.2.2 → orgmunge-0.2.4}/pyproject.toml +1 -1
- {orgmunge-0.2.2 → orgmunge-0.2.4}/src/orgmunge/classes.py +23 -2
- orgmunge-0.2.4/src/orgmunge/parser.out +1970 -0
- {orgmunge-0.2.2 → orgmunge-0.2.4}/src/orgmunge/parser.py +2 -0
- orgmunge-0.2.4/src/orgmunge/parsetab.py +110 -0
- orgmunge-0.2.2/src/orgmunge/Untitled Document +0 -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.4}/LICENSE +0 -0
- {orgmunge-0.2.2 → orgmunge-0.2.4}/README.org +0 -0
- {orgmunge-0.2.2 → orgmunge-0.2.4}/src/orgmunge/__init__.py +0 -0
- {orgmunge-0.2.2 → orgmunge-0.2.4}/src/orgmunge/lexer.py +0 -0
- {orgmunge-0.2.2 → orgmunge-0.2.4}/src/orgmunge/todos.json +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: orgmunge
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Programmatically modify Orgmode documents
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: durableOne
|
|
@@ -11,6 +11,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
15
|
Requires-Dist: ply (>=3.11,<4.0)
|
|
15
16
|
Description-Content-Type: text/plain
|
|
16
17
|
|
|
@@ -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
|
|
@@ -623,7 +637,7 @@ class Heading():
|
|
|
623
637
|
def get_drawer_by_name(self, name: str) -> Optional[Drawer]:
|
|
624
638
|
"Return the named drawer if it exists, or None if it doesn't"
|
|
625
639
|
try:
|
|
626
|
-
return next(d for d in self.drawers if d.name == name)
|
|
640
|
+
return next(d for d in (self.drawers or []) if d.name == name)
|
|
627
641
|
except StopIteration:
|
|
628
642
|
return None
|
|
629
643
|
|
|
@@ -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 ""
|