Permalink
Browse files

Refactor code to reflect renaming to sagecell

  • Loading branch information...
1 parent b4dc28e commit 037aedf8aacfbb24c22ad5eefd8e84aefbd7a588 @kramer314 kramer314 committed Jan 25, 2012
View
@@ -13,7 +13,7 @@ met:
the documentation and/or other materials provided with the
distribution.
- c. Neither the name of the Single Cell project nor the names of its
+ c. Neither the name of the Sage Cell project nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
View
@@ -207,17 +207,17 @@ MongoDB
environment so that the environment is trusted.
Set up an admin user, authenticate, then set up a user for the
- ``singlecelldb`` database. Since we include the
- ``<SINGLECELL_USER>`` and ``<SINGLECELL_PASSWORD>`` in a URL later,
+ ``sagecelldb`` database. Since we include the
+ ``<SAGECELL_USER>`` and ``<SAGECELL_PASSWORD>`` in a URL later,
it's helpful if neither of them contain any of ``%:/@`` (any
length of password with letters and numbers would be okay). ::
$SERVER/mongodb-linux-x86_64-1.8.2/bin/mongo --port <MONGODB_PORT> # start up mongo client
> use admin
> db.addUser("<ADMIN_USER>", "<ADMIN_PASSWORD>")
> db.auth("<ADMIN_USER>", "<ADMIN_PASSWORD>")
- > use singlecelldb
- > db.addUser("<SINGLECELL_USER>", "<SINGLECELL_PASSWORD>")
+ > use sagecelldb
+ > db.addUser("<SAGECELL_USER>", "<SAGECELL_PASSWORD>")
> quit()
nginx
@@ -286,19 +286,19 @@ restrictions; this account will be executing arbitrary user code).
fully automatically.
3. Create a configuration file
- ``$SERVER/sage-cell-server/singlecell_config.py`` by copying and
+ ``$SERVER/sage-cell-server/sagecell_config.py`` by copying and
modifying
- ``$SERVER/sage-cell-server/singlecell_config.py.default``. The
+ ``$SERVER/sage-cell-server/sagecell_config.py.default``. The
``mongo_uri`` should be set to
- ``mongodb://<SINGLECELL_USER>:<SINGLECELL_PASSWORD>@localhost:<MONGODB_PORT>``.
+ ``mongodb://<SAGECELL_USER>:<SAGECELL_PASSWORD>@localhost:<MONGODB_PORT>``.
If you will be running the server using Sage, replace the line
``python='python'`` with ``python='sage -python'``.
- .. warning:: Make the ``singlecell_config.py`` file *only* readable by
+ .. warning:: Make the ``sagecell_config.py`` file *only* readable by
the trusted account, not by the untrusted account, since it
contains the password to the database::
- chmod 600 singlecell_config.py
+ chmod 600 sagecell_config.py
4. Start uWSGI. The ``-p 50`` means that uWSGI will launch 50 workers
to handle incoming requests. Adjust this to suit your needs. ::
View
@@ -20,7 +20,7 @@
import pymongo.objectid
from pymongo.objectid import ObjectId
from pymongo import ASCENDING, DESCENDING
-from singlecell_config import mongo_config
+from sagecell_config import mongo_config
from util import log
class DB(db.DB):
View
@@ -46,8 +46,8 @@
import json
from json import dumps, loads
from hashlib import sha1
-import interact_singlecell
-import singlecell_exec_config as CONFIG
+import interact_sagecell
+import sagecell_exec_config as CONFIG
try:
import sage
@@ -61,8 +61,8 @@
sys._sage_messages=MESSAGE
sys._sage_upload_file_pipe=_file_upload_send
def _update_interact(id, control_vals):
- import interact_singlecell
- interact_info = interact_singlecell._INTERACTS[id]
+ import interact_sagecell
+ interact_info = interact_sagecell._INTERACTS[id]
kwargs = interact_info["state"].copy()
controls = interact_info["controls"]
for var,value in control_vals.items():
@@ -71,7 +71,7 @@ def _update_interact(id, control_vals):
if c.preserve_state:
interact_info["state"][var]=kwargs[var]
- interact_singlecell._INTERACTS[id]["function"](control_vals=kwargs)
+ interact_sagecell._INTERACTS[id]["function"](control_vals=kwargs)
"""
user_code_sage="""
@@ -91,12 +91,12 @@ def _update_interact(id, control_vals):
# pass
-# singlecell specific code:
-from interact_singlecell import * # override the interact functionality
+# sagecell specific code:
+from interact_sagecell import * # override the interact functionality
from interact_compatibility import * # override the interact functionality
import sage.misc.misc
-import singlecell_exec_config
-sage.misc.misc.EMBEDDED_MODE=singlecell_exec_config.EMBEDDED_MODE
+import sagecell_exec_config
+sage.misc.misc.EMBEDDED_MODE=sagecell_exec_config.EMBEDDED_MODE
"""+user_code
class QueueOut(StringIO.StringIO):
@@ -560,7 +560,7 @@ def execProcess(session, message_queue, output_handler, resource_limits, sysargs
with output_handler as MESSAGE:
try:
locals={'MESSAGE': MESSAGE,
- 'interact_singlecell': interact_singlecell,
+ 'interact_sagecell': interact_sagecell,
'_file_upload_send': upload_send}
if enable_sage and sage_mode:
locals['sage'] = sage
@@ -614,7 +614,7 @@ def execProcess(session, message_queue, output_handler, resource_limits, sysargs
new_files=file_parent.recv()
old_files.update(new_files)
# TODO: security implications here calling something that the user had access to.
- timeout=max(0,min(float(interact_singlecell.__single_cell_timeout__), MAX_TIMEOUT))
+ timeout=max(0,min(float(interact_sagecell.__sage_cell_timeout__), MAX_TIMEOUT))
file_list=[]
for filename in os.listdir(os.getcwd()):
View
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Python Compute Server documentation build configuration file, created by
+# Sage Cell Server documentation build configuration file, created by
# sphinx-quickstart on Fri May 13 22:12:46 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
@@ -42,7 +42,7 @@
master_doc = 'index'
# General information about the project.
-project = u'Python Compute Server'
+project = u'Sage Cell Server'
copyright = u'2011, Jason Grout, Ira Hanson, Alex Kramer, William Stein'
# The version info for the project you're documenting, acts as replacement for
@@ -166,7 +166,7 @@
#html_file_suffix = None
# Output file base name for HTML help builder.
-htmlhelp_basename = 'PythonComputeServerdoc'
+htmlhelp_basename = 'SagecellServerdoc'
# -- Options for LaTeX output --------------------------------------------------
@@ -180,7 +180,7 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
- ('index', 'PythonComputeServer.tex', u'Python Compute Server Documentation',
+ ('index', 'SagecellServer.tex', u'Sage Cell Server Documentation',
u'Jason Grout, Ira Hanson, Alex Kramer, William Stein', 'manual'),
]
@@ -213,7 +213,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- ('index', 'pythoncomputeserver', u'Python Compute Server Documentation',
+ ('index', 'sagecellserver', u'Sage Cell Server Documentation',
[u'Jason Grout, Ira Hanson, Alex Kramer, William Stein'], 1)
]
Oops, something went wrong.

0 comments on commit 037aedf

Please sign in to comment.