1. Takafumi Arakaki
  2. Orgnode


Takafumi Arakaki  committed 7954437

change function name: get_{tags_and_heading, scheduled, deadline} -> find_{...}

  • Participants
  • Parent commits 7bbcf1f
  • Branches default

Comments (0)

Files changed (2)

File Orgnode.py

View file
     return re_date
 _RE_DATE = _re_compile_date()
-def get_daterangelist(string):
+def find_daterangelist(string):
     datelist = []
     rangelist = []
     for dm in _RE_DATE.findall(string):
 _RE_SCHEDULED = re.compile(
-def get_scheduled(line):
+def find_scheduled(line):
     Find SCHEDULED from given string.
     Return datetime object if found else None.
 _RE_DEADLINE = re.compile(
-def get_deadline(line):
+def find_deadline(line):
     Find DEADLINE from given string.
     Return datetime object if found else None.
     return deadline_date
 _RE_TAGSRCH = re.compile('(.*?)\s*:(.*?):(.*?)$')
-def get_tags_and_heading(heading):
+def find_tags_and_heading(heading):
     Get first tag, all tags, and heading without tags.
     This is helper function of makelist.
             level = hdng.group(1)
             heading =  hdng.group(2)
             bodytext = ""
-            (tag1, alltags, heading) = get_tags_and_heading(heading)
+            (tag1, alltags, heading) = find_tags_and_heading(heading)
         else:      # we are processing a non-heading line
             if line.startswith('#+SEQ_TODO'):
                 todos |= set(_RE_TODO_KWDS.findall(line))
             if prop_srch:
                 propdict[prop_srch.group(1)] = prop_srch.group(2)
-            _sched_date = get_scheduled(line)
-            _deadline_date = get_deadline(line)
+            _sched_date = find_scheduled(line)
+            _deadline_date = find_deadline(line)
             sched_date = _sched_date or sched_date
             deadline_date = _deadline_date or deadline_date
             if not _sched_date and not _deadline_date:
-                (dl, rl) = get_daterangelist(line)
+                (dl, rl) = find_daterangelist(line)
                 datelist += dl
                 rangelist += rl
             if not (line.startswith('#') or _sched_date or _deadline_date):

File test/test.py

View file
 from glob import glob
 from nose.tools import eq_
-from Orgnode import Orgnode, makelist, get_daterangelist, get_datetime
+from Orgnode import Orgnode, makelist, find_daterangelist, get_datetime
 TESTDIR = os.path.dirname(__file__)
         yield (check_data, dataname)
-def test_get_daterangelist():
+def test_find_daterangelist():
     datefmt0 = "<%(Y)04d-%(M)02d-%(D)02d %(d)s>"
     datefmt1 = "<%(Y)04d-%(M)02d-%(D)02d %(d)s %(h)02d:%(m)02d>"
          get_datetime(d1['Y'], d1['M'], d1['D'], d1['h'], d1['m']))]
     for context in ["%s", " %s", "%s ", "aaa%sbbb"]:
-        (datelist, rangelist) =  get_daterangelist(context % datestr)
+        (datelist, rangelist) = find_daterangelist(context % datestr)
         for (des, act) in zip(desired_datelist, datelist):
             assert des == act
         for (des, act) in zip(desired_rangelist, rangelist):