1.1 --- a/imiptools/content.py Thu Feb 05 22:36:34 2015 +0100
1.2 +++ b/imiptools/content.py Thu Feb 05 22:37:30 2015 +0100
1.3 @@ -397,6 +397,13 @@
1.4 utcnow = to_timezone(datetime.utcnow(), "UTC")
1.5 self.obj["DTSTAMP"] = [(format_datetime(dtstamp > utcnow and dtstamp or utcnow), {})]
1.6
1.7 + def set_sequence(self, increment=False):
1.8 +
1.9 + "Update the SEQUENCE in the current object."
1.10 +
1.11 + sequence = self.obj.get_value("SEQUENCE") or "0"
1.12 + self.obj["SEQUENCE"] = [(str(int(sequence) + (increment and 1 or 0)), {})]
1.13 +
1.14 # Handler registry.
1.15
1.16 methods = {