File: rrulewrapper.py

package info (click to toggle)
python-dateutil 1.5%2Bdfsg-0.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 740 kB
  • sloc: python: 6,451; makefile: 19
file content (16 lines) | stat: -rw-r--r-- 476 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from rrule import *

class rrulewrapper:
    def __init__(self, freq, **kwargs):
        self._construct = kwargs.copy()
        self._construct["freq"] = freq
        self._rrule = rrule(**self._construct)

    def __getattr__(self, name):
        if name in self.__dict__:
            return self.__dict__[name]
        return getattr(self._rrule, name)
    
    def set(self, **kwargs):
        self._construct.update(kwargs)
        self._rrule = rrule(**self._construct)