-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
William Strecker-Kellogg
committed
Apr 14, 2021
1 parent
09566fa
commit f009aee
Showing
10 changed files
with
71 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ include README.md | |
|
||
graft conf | ||
graft cron | ||
graft static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .icform import icform | ||
from .otherforms import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
from jinja2 import Template | ||
from tornado.log import app_log | ||
|
||
from .formspawners import ParamForm | ||
|
||
import sqlite3 | ||
|
||
__all__ = ['CFNForm', 'NSLSForm', 'KNLForm', 'SDCCForm'] | ||
|
||
|
||
class CFNForm(ParamForm): | ||
|
||
source = 'static/cfn.html' | ||
|
||
def massage_options(self, formdata): | ||
data = super().massage_options(formdata) | ||
intify = {'req_memory', 'req_nprocs'} | ||
data = {k: int(v) if v in intify else v for k, v in data.items()} | ||
data['req_runtime'] = '%d:00' % int(data['req_runtime']) | ||
return data | ||
|
||
def generate(self): | ||
app_log.info("Generating form from: %s", self) | ||
return Template(super().generate()).render() | ||
|
||
|
||
class NSLSForm(ParamForm): | ||
source = 'static/nsls.html' | ||
|
||
def generate(self): | ||
app_log.info("Generating form from: %s", self) | ||
return Template(super().generate()).render() | ||
|
||
|
||
class KNLForm(ParamForm): | ||
|
||
source = 'static/knl.html' | ||
|
||
def massage_options(self, formdata): | ||
data = super().massage_options(formdata) | ||
data['req_runtime'] = '%d:00' % int(data['req_runtime']) | ||
return data | ||
|
||
def generate(self): | ||
app_log.info("Generating form from: %s", self) | ||
return Template(super().generate()).render() | ||
|
||
|
||
class SDCCForm(ParamForm): | ||
|
||
source = 'static/sdcc.html' | ||
|
||
def massage_options(self, formdata): | ||
data = super().massage_options(formdata) | ||
data['req_runtime'] = '%d:00' % int(data['req_runtime']) | ||
return data | ||
|
||
def generate(self): | ||
app_log.info("Generating form from: %s", self) | ||
return Template(super().generate()).render() |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters