-# Cumulus: Smart Filesystem Backup to Dumb Servers
-#
-# Copyright (C) 2012 Google Inc.
-# Written by Michael Vrable <mvrable@cs.ucsd.edu>
+# Cumulus: Efficient Filesystem Backup to the Cloud
+# Copyright (C) 2012 The Cumulus Developers
+# See the AUTHORS file for a list of contributors.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
format.
"""
-import ConfigParser
+from __future__ import division, print_function, unicode_literals
+
+try:
+ import configparser
+except ImportError:
+ import ConfigParser as configparser
import datetime
import re
for s in spec.split():
m = class_re.match(s)
if not m:
- print "Invalid retain spec:", s
+ print("Invalid retain spec:", s)
continue
period = datetime.timedelta()
classname = m.group(1)
seconds = int(m.group(1)) * _TIME_UNITS[m.group(2)]
period = period + datetime.timedelta(seconds=seconds)
intervalspec = m.group(3)
- print classname, period
policy.add_policy(classname, period)
return policy
class CumulusConfig(object):
def __init__(self, filename):
"""Parse a Cumulus backup configuration from the specified file."""
- self._config = ConfigParser.RawConfigParser()
+ self._config = configparser.RawConfigParser()
self._config.readfp(open(filename))
def get_global(self, key):