climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1570970 - in /incubator/climate/trunk/ocw-ui/backend: config.py directory_helpers.py processing.py
Date Sun, 23 Feb 2014 04:45:11 GMT
Author: joyce
Date: Sun Feb 23 04:45:11 2014
New Revision: 1570970

URL: http://svn.apache.org/r1570970
Log:
CLIMATE-332 - Factor out config to separate module

Added:
    incubator/climate/trunk/ocw-ui/backend/config.py
Modified:
    incubator/climate/trunk/ocw-ui/backend/directory_helpers.py
    incubator/climate/trunk/ocw-ui/backend/processing.py

Added: incubator/climate/trunk/ocw-ui/backend/config.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw-ui/backend/config.py?rev=1570970&view=auto
==============================================================================
--- incubator/climate/trunk/ocw-ui/backend/config.py (added)
+++ incubator/climate/trunk/ocw-ui/backend/config.py Sun Feb 23 04:45:11 2014
@@ -0,0 +1,26 @@
+#
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#
+
+''' Configuration settings for the OCW backend webservices. '''
+
+# Directory where all results are save/cache-ing is done
+WORK_DIR = '/tmp/ocw/'
+
+# Parent directory that the frontend is allowed to load model files from.
+# Any directory under this will be visible to the frontend when loading
+# a local model file.
+PATH_LEADER = '/usr/local/ocw'

Modified: incubator/climate/trunk/ocw-ui/backend/directory_helpers.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw-ui/backend/directory_helpers.py?rev=1570970&r1=1570969&r2=1570970&view=diff
==============================================================================
--- incubator/climate/trunk/ocw-ui/backend/directory_helpers.py (original)
+++ incubator/climate/trunk/ocw-ui/backend/directory_helpers.py Sun Feb 23 04:45:11 2014
@@ -21,10 +21,9 @@ from bottle import Bottle, request
 import os
 import re
 
-dir_app = Bottle()
+from config import WORK_DIR, PATH_LEADER
 
-PATH_LEADER = "/usr/local/ocw"
-WORK_DIR = "/tmp/ocw"
+dir_app = Bottle()
 
 @dir_app.route('/list/')
 @dir_app.route('/list/<dir_path:path>')

Modified: incubator/climate/trunk/ocw-ui/backend/processing.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw-ui/backend/processing.py?rev=1570970&r1=1570969&r2=1570970&view=diff
==============================================================================
--- incubator/climate/trunk/ocw-ui/backend/processing.py (original)
+++ incubator/climate/trunk/ocw-ui/backend/processing.py Sun Feb 23 04:45:11 2014
@@ -24,6 +24,8 @@ import os
 
 from bottle import Bottle, request
 
+from config import WORK_DIR
+
 import ocw.data_source.local as local
 import ocw.data_source.rcmed as rcmed
 import ocw.dataset_processor as dsp
@@ -36,9 +38,6 @@ import numpy as np
 
 processing_app = Bottle()
 
-# TODO: Factor this out of all but the main modules
-WORK_DIR = "/tmp/ocw"
-
 @processing_app.route('/run_evaluation/', method='POST')
 def run_evaluation():
     ''' Run an OCW Evaluation.



Mime
View raw message