<s> from django . shortcuts import render <EOL> from django . utils . translation import ugettext as _ <EOL> from freenasUI . freeadmin . apppool import appPool <EOL> from freenasUI . freeadmin . views import JsonResp <EOL> from freenasUI . tasks import models <EOL> def home ( request ) : <EOL> view = appPool . hook_app_index ( '<STR_LIT>' , request ) <EOL> view = filter ( None , view ) <EOL> if view : <EOL> return view [ <NUM_LIT:0> ] <EOL> return render ( request , '<STR_LIT>' , { <EOL> '<STR_LIT>' : request . GET . get ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> } ) <EOL> def cron_run ( request , oid ) : <EOL> cron = models . CronJob . objects . get ( pk = oid ) <EOL> if request . method == "<STR_LIT:POST>" : <EOL> cron . run ( ) <EOL> return JsonResp ( request , message = _ ( "<STR_LIT>" ) ) <EOL> return render ( request , '<STR_LIT>' , { <EOL> '<STR_LIT>' : cron , <EOL> } ) <EOL> def rsync_run ( request , oid ) : <EOL> rsync = models . Rsync . objects . get ( pk = oid ) <EOL> if request . method == "<STR_LIT:POST>" : <EOL> rsync . run ( ) <EOL> return JsonResp ( request , message = _ ( "<STR_LIT>" ) ) <EOL> return render ( request , '<STR_LIT>' , { <EOL> '<STR_LIT>' : rsync , <EOL> } ) </s>
