Translate human time ranges to a machine-readable way

__init__.py 500B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/python
  2. import re
  3. def Boundary(object):
  4. class Plus:
  5. pass
  6. class Minus:
  7. pass
  8. def __init__(self, which, what):
  9. sign = None
  10. offset = 0
  11. parts = re.match('', which)
  12. if '+' in which:
  13. offset_phrase = which.split('+')
  14. class RangeBoundary(object):
  15. def __init__(self, phrase):
  16. self.phrase = phrase
  17. class Range(object):
  18. def __init__(self, start, end):
  19. self.start = start
  20. self.end = end