class UserCrontab:

    def __init__(self, buildout, name, options):
        self.options = options
        options['entry'] = '%s\t%s' % (options['times'], options['command'])
        self.comment = options.get('comment')
        if not bool_option(self.options, 'enabled', default=True):
            self.options['entry'] = '# ' + self.options['entry']

        # readcrontab and writecrontab are solely for testing.
        readcrontab = self.options.get('readcrontab', None)
        writecrontab = self.options.get('writecrontab', None)

        self.options['identifier'] = '%s [%s]' % (
            buildout['buildout']['directory'], name)
        self.crontab = UserCrontabManager(
            readcrontab, writecrontab,
            identifier=self.options['identifier'])

    def install(self):
        self.crontab.read_crontab()
        self.crontab.add_entry(self.options['entry'], self.comment)
        self.crontab.write_crontab()
        return ()

    def update(self):
        self.install()
Example #2
0
class UserCrontab:
    def __init__(self, buildout, name, options):
        self.options = options
        options['entry'] = '%s\t%s' % (options['times'], options['command'])
        self.comment = options.get('comment')
        if not bool_option(self.options, 'enabled', default=True):
            self.options['entry'] = '# ' + self.options['entry']

        # readcrontab and writecrontab are solely for testing.
        readcrontab = self.options.get('readcrontab', None)
        writecrontab = self.options.get('writecrontab', None)

        self.options['identifier'] = '%s [%s]' % (
            buildout['buildout']['directory'], name)
        self.crontab = UserCrontabManager(
            readcrontab, writecrontab, identifier=self.options['identifier'])

    def install(self):
        self.crontab.read_crontab()
        self.crontab.add_entry(self.options['entry'], self.comment)
        self.crontab.write_crontab()
        return ()

    def update(self):
        self.install()
class UserCrontab:
    def __init__(self, buildout, name, options):
        self.options = options
        options["entry"] = "%s\t%s" % (options["times"], options["command"])
        readcrontab = self.options.get("readcrontab", None)
        writecrontab = self.options.get("writecrontab", None)
        self.options["identifier"] = "%s [%s]" % (buildout["buildout"]["directory"], name)
        self.crontab = UserCrontabManager(readcrontab, writecrontab, identifier=self.options["identifier"])

    def install(self):
        self.crontab.read_crontab()
        self.crontab.add_entry(self.options["entry"])
        self.crontab.write_crontab()
        return ()

    def update(self):
        self.install()
Example #4
0
class UserCrontab:
    def __init__(self, buildout, name, options):
        self.options = options
        options['entry'] = '%s\t%s' % (options['times'], options['command'])
        readcrontab = self.options.get('readcrontab', None)
        writecrontab = self.options.get('writecrontab', None)
        identifier = self.options.get('identifier', None)
        if identifier is None:
            self.options['identifier'] = '%s [%s]' % (
                buildout['buildout']['directory'], name)
        self.crontab = UserCrontabManager(
            readcrontab, writecrontab, identifier=self.options['identifier'])

    def install(self):
        self.crontab.read_crontab()
        self.crontab.add_entry(self.options['entry'])
        self.crontab.write_crontab()
        return ()

    def update(self):
        self.install()
class UserCrontab:

    def __init__(self, buildout, name, options):
        self.options = options
        options['entry'] = '%s\t%s' % (options['times'], options['command'])
        readcrontab = self.options.get('readcrontab', None)
        writecrontab = self.options.get('writecrontab', None)
        identifier = self.options.get('identifier', None)
        if identifier is None:
            self.options['identifier'] = '%s [%s]' % (
                buildout['buildout']['directory'], name)
        self.crontab = UserCrontabManager(
            readcrontab, writecrontab,
            identifier=self.options['identifier'])

    def install(self):
        self.crontab.read_crontab()
        self.crontab.add_entry(self.options['entry'])
        self.crontab.write_crontab()
        return ()

    def update(self):
        self.install()