[cig-commits] r8965 - in cs/portal/trunk/magportal/MagWebPortal: .
static/samples
wei at geodynamics.org
wei at geodynamics.org
Thu Dec 20 18:06:34 PST 2007
Author: wei
Date: 2007-12-20 18:06:34 -0800 (Thu, 20 Dec 2007)
New Revision: 8965
Removed:
cs/portal/trunk/magportal/MagWebPortal/cig-logo_small-initials.ico
Modified:
cs/portal/trunk/magportal/MagWebPortal/models.py
cs/portal/trunk/magportal/MagWebPortal/notifications.py
cs/portal/trunk/magportal/MagWebPortal/static/samples/par.bnch1
cs/portal/trunk/magportal/MagWebPortal/static/samples/par.bnch1.txt
cs/portal/trunk/magportal/MagWebPortal/urls.py
cs/portal/trunk/magportal/MagWebPortal/views.py
Log:
Updated views.py and url.py.0
Deleted: cs/portal/trunk/magportal/MagWebPortal/cig-logo_small-initials.ico
===================================================================
(Binary files differ)
Modified: cs/portal/trunk/magportal/MagWebPortal/models.py
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/models.py 2007-12-21 02:02:48 UTC (rev 8964)
+++ cs/portal/trunk/magportal/MagWebPortal/models.py 2007-12-21 02:06:34 UTC (rev 8965)
@@ -34,7 +34,7 @@
runid = models.CharField(maxlength=100)
init = models.IntegerField(default=404)
infile = models.CharField(maxlength=20)
- treset = models.BooleanField(core=True, default=True)
+ treset = models.BooleanField(core=True, default=False)
samp = models.FloatField(max_digits=10, decimal_places=10, default=0.1000)
nstep = models.IntegerField(default=200)
nprnt = models.IntegerField(default=8)
Modified: cs/portal/trunk/magportal/MagWebPortal/notifications.py
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/notifications.py 2007-12-21 02:02:48 UTC (rev 8964)
+++ cs/portal/trunk/magportal/MagWebPortal/notifications.py 2007-12-21 02:06:34 UTC (rev 8965)
@@ -12,7 +12,7 @@
"",
"To download the output, visit the following web page:",
"",
- "https://dynamo.geodynamics.org%s/simulations/%d/" % (URL_ROOT, sim.id),
+ "http://dynamo.geodynamics.org%s/simulations/%d/" % (URL_ROOT, sim.id),
"",
"Sincerely,",
"The Web Portal",
@@ -49,7 +49,7 @@
message.extend([
"""NOTE: Before this new user can run simulations, you must approve them by selecting the "approved" checkbox on the following page:""",
"",
- "https://dynamo.geodynamics.org/admin/%s/userinfo/%d/" % (APP_LABEL, userInfo._get_pk_val()),
+ "http://dynamo.geodynamics.org/admin/%s/userinfo/%d/" % (APP_LABEL, userInfo._get_pk_val()),
"",
])
message.extend([
Modified: cs/portal/trunk/magportal/MagWebPortal/static/samples/par.bnch1
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/static/samples/par.bnch1 2007-12-21 02:02:48 UTC (rev 8964)
+++ cs/portal/trunk/magportal/MagWebPortal/static/samples/par.bnch1 2007-12-21 02:06:34 UTC (rev 8965)
@@ -1,8 +1,7 @@
&contrl
- outfile="bench1rrrr",
- infile="d3.bench1rrr",
+ outfile="bench1r",
runid="Ra=1.0E5 Ek=1E-3 Els=0 Pr=1 Pm=5 RR TT H=0",
- init=0,
+ init=404,
treset=.false.,
samp=0.1000,
nstep=1000,
Modified: cs/portal/trunk/magportal/MagWebPortal/static/samples/par.bnch1.txt
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/static/samples/par.bnch1.txt 2007-12-21 02:02:48 UTC (rev 8964)
+++ cs/portal/trunk/magportal/MagWebPortal/static/samples/par.bnch1.txt 2007-12-21 02:06:34 UTC (rev 8965)
@@ -1,6 +1,6 @@
&contrl
- outfile="bench1rrrr",
- infile="d3.bench1rrr",
+ outfile="bench1r",
+ infile="d3.bench1",
runid="Ra=1.0E5 Ek=1E-3 Els=0 Pr=1 Pm=5 RR TT H=0",
init=0,
treset=.false.,
Modified: cs/portal/trunk/magportal/MagWebPortal/urls.py
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/urls.py 2007-12-21 02:02:48 UTC (rev 8964)
+++ cs/portal/trunk/magportal/MagWebPortal/urls.py 2007-12-21 02:06:34 UTC (rev 8965)
@@ -120,6 +120,8 @@
(r'^simulations/(?P<object_id>\d+)/delete/$', 'django.views.generic.create_update.delete_object', simulation_delete_args),
(r'^simulations/(?P<object_id>\d+)/run/$', view('run_simulation')),
(r'^simulations/(?P<sim_id>\d+)/inputparams$', view('inputparams_txt')),
+ (r'^simulations/(?P<object_id>\d+)/ParFile\.txt$','MagWebPortal.views.simulation_input_parameters_txt'),
+ (r'^simulations/(?P<object_id>\d+)/args\.py$','MagWebPortal.views.simulation_arguments_txt'),
# inputparams
(r'^inputparams/$', view('inputparam_index')),
Modified: cs/portal/trunk/magportal/MagWebPortal/views.py
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/views.py 2007-12-21 02:02:48 UTC (rev 8964)
+++ cs/portal/trunk/magportal/MagWebPortal/views.py 2007-12-21 02:06:34 UTC (rev 8965)
@@ -136,7 +136,7 @@
def simulation_detail(request, object_id):
- from django.views.generic.file_detail import object_detail
+ from django.views.generic.list_detail import object_detail
return object_detail(request, Simulation.user_objects.all(), object_id)
simulation_detail = login_required(simulation_detail)
@@ -421,6 +421,20 @@
return response
+def simulation_input_parameters_txt(request, object_id):
+ simulation = get_object_or_404(Simulation, id=object_id)
+ return input_parameters_txt(request, simulation.InputdataFile.id)
+
+
+def simulation_arguments_txt(request, object_id):
+ response = HttpResponse(mimetype='text/plain')
+
+ simulation = get_object_or_404(Simulation, id=object_id)
+ args = [simulation.truncorder, simulation.logisym]
+ response.write(repr(args))
+ return response
+
+
def list_txt(request, object_id):
# This illustrates how to generate an input file directly.
@@ -448,6 +462,7 @@
shutil.copyfileobj(stream, response)
stream.close()
return response
+
def maginputformat_txt(request, object_id):
from models import InputdataFile
inputdatafile = get_object_or_404(InputdataFile, id=object_id)
@@ -474,12 +489,12 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-def run_file(request):
- from django.views.generic.file_detail import object_file
+def run_list(request):
+ from django.views.generic.list_detail import object_list
new = request.GET.get('new')
if new is not None:
new = int(new)
- return object_file(request,
+ return object_list(request,
Run.objects.filter(simulation__user = request.user).order_by('-started'),
allow_empty=True,
extra_context = {'new': new},
@@ -491,9 +506,9 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-def job_file(request):
- from django.views.generic.file_detail import object_file
- return object_file(request,
+def job_list(request):
+ from django.views.generic.list_detail import object_list
+ return object_list(request,
Job.objects.filter(run__simulation__user = request.user),
allow_empty=True)
@@ -757,9 +772,9 @@
if run.status in ['done', 'error']:
run.finished = datetime.datetime.now()
if run.status == 'error':
- notify_admins_of_failed_run(run)
+ notifications.notify_admins_of_failed_simulation(run.simulation)
else:
- notify_user_of_successful_run(run)
+ notifications.notify_user_of_successful_simulation(run.simulation)
run.save()
response.write(repr('OK'))
return response
More information about the cig-commits
mailing list