How to use the crontab.crontabs.CronTabs function in crontab

To help you get started, we’ve selected a few crontab examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Stumblinbear / Prism / prism / plugins- / system / prism_system / views.py View on Github external
def cron_job_edit(crontab_id=0, cron_id=0):
	if request.method == 'POST':
		obj = parse_cron_widget(CronTabs()[crontab_id - 1], cron_id)
		if obj != None:
			return obj
	
	try:
		return render_template('cron_job_edit.html', cron=CronTabs()[crontab_id - 1].crons[cron_id - 1])
	except:
		return redirect(url_for('system.cron_jobs'))
github achaudhry / adhan / crontab / crontabs.py View on Github external
def __new__(cls, *args, **kw):
        if not cls._self:
            cls._self = super(CronTabs, cls).__new__(cls, *args, **kw)
        return cls._self
github Stumblinbear / Prism / prism / plugins- / system / prism_system / views.py View on Github external
if request.method == 'POST':
		action = request.form['action']
		if action == 'delete':
			crontab_id = int(request.form['crontab_id'])
			cron_id = int(request.form['cron_id'])
			
			crontab = CronTabs()[crontab_id - 1]
			job = crontab.crons[cron_id - 1]
			crontab.remove(job)
			crontab.write()
		else:
			tabfile = request.form['tabfile']
			obj = parse_cron_widget(CronTab(tabfile=tabfile))
			if obj != None:
				return obj
	for crontab in CronTabs():
		for cron in crontab:
			print(cron)
	return render_template('cron_jobs.html', crontabs=CronTabs(), crontab_locations=get_cron_locations())
github Stumblinbear / Prism / prism / plugins- / system / prism_system / views.py View on Github external
crontab_id = int(request.form['crontab_id'])
			cron_id = int(request.form['cron_id'])
			
			crontab = CronTabs()[crontab_id - 1]
			job = crontab.crons[cron_id - 1]
			crontab.remove(job)
			crontab.write()
		else:
			tabfile = request.form['tabfile']
			obj = parse_cron_widget(CronTab(tabfile=tabfile))
			if obj != None:
				return obj
	for crontab in CronTabs():
		for cron in crontab:
			print(cron)
	return render_template('cron_jobs.html', crontabs=CronTabs(), crontab_locations=get_cron_locations())
github Stumblinbear / Prism / prism / plugins- / system / prism_system / views.py View on Github external
def cron_jobs():
	if request.method == 'POST':
		action = request.form['action']
		if action == 'delete':
			crontab_id = int(request.form['crontab_id'])
			cron_id = int(request.form['cron_id'])
			
			crontab = CronTabs()[crontab_id - 1]
			job = crontab.crons[cron_id - 1]
			crontab.remove(job)
			crontab.write()
		else:
			tabfile = request.form['tabfile']
			obj = parse_cron_widget(CronTab(tabfile=tabfile))
			if obj != None:
				return obj
	for crontab in CronTabs():
		for cron in crontab:
			print(cron)
	return render_template('cron_jobs.html', crontabs=CronTabs(), crontab_locations=get_cron_locations())