Browse Source

HUE-1475 [core] Switch back from spawning server

- Remove Spawning
- Remove eventlet
- Remove greenlet
- Remove django moxy
- Remove shell application
Abraham Elmahrek 12 years ago
parent
commit
3467bcbe0e
100 changed files with 0 additions and 7985 deletions
  1. 0 2
      apps/Makefile
  2. 0 2
      apps/jobbrowser/src/jobbrowser/__init__.py
  3. 0 33
      apps/shell/Makefile
  4. 0 2
      apps/shell/babel.cfg
  5. 0 1
      apps/shell/hueversion.py
  6. 0 48
      apps/shell/setup.py
  7. 0 2
      apps/shell/src/shell/.gitignore
  8. 0 29
      apps/shell/src/shell/Makefile
  9. 0 15
      apps/shell/src/shell/__init__.py
  10. 0 108
      apps/shell/src/shell/conf.py
  11. 0 59
      apps/shell/src/shell/constants.py
  12. 0 15
      apps/shell/src/shell/forms.py
  13. 0 78
      apps/shell/src/shell/locale/de/LC_MESSAGES/django.po
  14. 0 88
      apps/shell/src/shell/locale/en_US.pot
  15. 0 78
      apps/shell/src/shell/locale/es/LC_MESSAGES/django.po
  16. 0 78
      apps/shell/src/shell/locale/fr/LC_MESSAGES/django.po
  17. 0 78
      apps/shell/src/shell/locale/ja/LC_MESSAGES/django.po
  18. 0 78
      apps/shell/src/shell/locale/ko/LC_MESSAGES/django.po
  19. 0 78
      apps/shell/src/shell/locale/pt/LC_MESSAGES/django.po
  20. 0 78
      apps/shell/src/shell/locale/pt_BR/LC_MESSAGES/django.po
  21. 0 78
      apps/shell/src/shell/locale/zh_CN/LC_MESSAGES/django.po
  22. 0 15
      apps/shell/src/shell/models.py
  23. 0 28
      apps/shell/src/shell/settings.py
  24. 0 228
      apps/shell/src/shell/setuid.c
  25. 0 755
      apps/shell/src/shell/shellmanager.py
  26. BIN
      apps/shell/src/shell/static/art/icon_shell_24.png
  27. BIN
      apps/shell/src/shell/static/art/shell.png
  28. BIN
      apps/shell/src/shell/static/help/images/23888153.png
  29. 0 151
      apps/shell/src/shell/static/help/index.html
  30. 0 34
      apps/shell/src/shell/templates/failed_to_create.mako
  31. 0 319
      apps/shell/src/shell/templates/index.mako
  32. 0 30
      apps/shell/src/shell/templates/no_such_user.mako
  33. 0 27
      apps/shell/src/shell/templates/not_running_spawning.mako
  34. 0 149
      apps/shell/src/shell/tests.py
  35. 0 27
      apps/shell/src/shell/urls.py
  36. 0 99
      apps/shell/src/shell/utils.py
  37. 0 138
      apps/shell/src/shell/views.py
  38. 0 23
      apps/shell/src/shell/windmilltests.py
  39. 0 5
      desktop/conf.dist/hue.ini
  40. 0 5
      desktop/conf/pseudo-distributed.ini.tmpl
  41. 0 9
      desktop/core/ext-py/Spawning-0.9.6/AUTHORS.txt
  42. 0 19
      desktop/core/ext-py/Spawning-0.9.6/LICENSE.txt
  43. 0 4
      desktop/core/ext-py/Spawning-0.9.6/MANIFEST.in
  44. 0 115
      desktop/core/ext-py/Spawning-0.9.6/NEWS.txt
  45. 0 126
      desktop/core/ext-py/Spawning-0.9.6/PKG-INFO
  46. 0 108
      desktop/core/ext-py/Spawning-0.9.6/README.rst
  47. 0 167
      desktop/core/ext-py/Spawning-0.9.6/pip-log.txt
  48. 0 67
      desktop/core/ext-py/Spawning-0.9.6/rc-scripts/conf.d/spawning
  49. 0 91
      desktop/core/ext-py/Spawning-0.9.6/rc-scripts/init.d/spawning
  50. 0 115
      desktop/core/ext-py/Spawning-0.9.6/rc-scripts/init.d/spawning.debian
  51. 0 5
      desktop/core/ext-py/Spawning-0.9.6/setup.cfg
  52. 0 74
      desktop/core/ext-py/Spawning-0.9.6/setup.py
  53. 0 37
      desktop/core/ext-py/Spawning-0.9.6/src/spawning/__init__.py
  54. 0 58
      desktop/core/ext-py/Spawning-0.9.6/src/spawning/django_factory.py
  55. 0 94
      desktop/core/ext-py/Spawning-0.9.6/src/spawning/memory_watcher.py
  56. 0 102
      desktop/core/ext-py/Spawning-0.9.6/src/spawning/paste_factory.py
  57. 0 119
      desktop/core/ext-py/Spawning-0.9.6/src/spawning/reloader_dev.py
  58. 0 143
      desktop/core/ext-py/Spawning-0.9.6/src/spawning/reloader_svn.py
  59. 0 341
      desktop/core/ext-py/Spawning-0.9.6/src/spawning/spawning_child.py
  60. 0 521
      desktop/core/ext-py/Spawning-0.9.6/src/spawning/spawning_controller.py
  61. 0 55
      desktop/core/ext-py/Spawning-0.9.6/src/spawning/util/__init__.py
  62. 0 171
      desktop/core/ext-py/Spawning-0.9.6/src/spawning/util/log_parser.py
  63. 0 366
      desktop/core/ext-py/Spawning-0.9.6/src/spawning/util/status.py
  64. 0 96
      desktop/core/ext-py/Spawning-0.9.6/src/spawning/util/system.py
  65. 0 82
      desktop/core/ext-py/Spawning-0.9.6/src/spawning/wsgi_factory.py
  66. 0 202
      desktop/core/ext-py/django-moxy/LICENSE.txt
  67. 0 7
      desktop/core/ext-py/django-moxy/README
  68. 0 26
      desktop/core/ext-py/django-moxy/README.markdown
  69. 0 3
      desktop/core/ext-py/django-moxy/moxy/__init__.py
  70. 0 150
      desktop/core/ext-py/django-moxy/moxy/base.py
  71. 0 8
      desktop/core/ext-py/django-moxy/moxy/tests.py
  72. 0 22
      desktop/core/ext-py/django-moxy/setup.py
  73. 0 71
      desktop/core/ext-py/eventlet-0.9.14/AUTHORS
  74. 0 23
      desktop/core/ext-py/eventlet-0.9.14/LICENSE
  75. 0 4
      desktop/core/ext-py/eventlet-0.9.14/MANIFEST.in
  76. 0 334
      desktop/core/ext-py/eventlet-0.9.14/NEWS
  77. 0 68
      desktop/core/ext-py/eventlet-0.9.14/PKG-INFO
  78. 0 50
      desktop/core/ext-py/eventlet-0.9.14/README
  79. 0 181
      desktop/core/ext-py/eventlet-0.9.14/README.twisted
  80. 0 94
      desktop/core/ext-py/eventlet-0.9.14/doc/Makefile
  81. BIN
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_images/threading_illustration.png
  82. 0 4
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/authors.txt
  83. 0 83
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/basic_usage.txt
  84. 0 113
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/design_patterns.txt
  85. 0 21
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/environment.txt
  86. 0 106
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/examples.txt
  87. 0 10
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/history.txt
  88. 0 54
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/hubs.txt
  89. 0 50
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/index.txt
  90. 0 19
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules.txt
  91. 0 27
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/backdoor.txt
  92. 0 6
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/corolocal.txt
  93. 0 61
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/db_pool.txt
  94. 0 5
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/debug.txt
  95. 0 5
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/event.txt
  96. 0 6
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/greenpool.txt
  97. 0 5
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/greenthread.txt
  98. 0 5
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/pools.txt
  99. 0 5
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/queue.txt
  100. 0 11
      desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/semaphore.txt

+ 0 - 2
apps/Makefile

@@ -39,7 +39,6 @@ APPS := about \
   jobsub \
   oozie \
   proxy \
-  shell \
   useradmin \
   impala \
   pig \
@@ -112,7 +111,6 @@ I18N_APPS := about \
   filebrowser \
   jobbrowser \
   jobsub \
-  shell \
   useradmin \
   oozie \
   impala \

+ 0 - 2
apps/jobbrowser/src/jobbrowser/__init__.py

@@ -15,8 +15,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import desktop.lib.eventlet_util
-
 import sys
 import os
 from desktop.supervisor import DjangoCommandSupervisee

+ 0 - 33
apps/shell/Makefile

@@ -1,33 +0,0 @@
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. 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.
-ifeq ($(ROOT),)
-  $(error "Error: Expect the environment variable $$ROOT to point to the Desktop installation")
-endif
-
-APP_NAME = shell
-include $(ROOT)/Makefile.sdk
-
-compile: setuid
-
-clean:: remove_setuid
-
-.PHONY: setuid
-setuid:
-	make -C src/shell
-
-.PHONY: remove_setuid
-remove_setuid:
-	make -C src/shell clean

+ 0 - 2
apps/shell/babel.cfg

@@ -1,2 +0,0 @@
-[python: src/shell/**.py]
-[mako: src/shell/templates/**.mako]

+ 0 - 1
apps/shell/hueversion.py

@@ -1 +0,0 @@
-../../VERSION

+ 0 - 48
apps/shell/setup.py

@@ -1,48 +0,0 @@
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. 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.
-from setuptools import setup, find_packages
-from hueversion import VERSION
-import os
-
-def expand_package_data(src_dirs, strip=""):
-  ret = []
-  for src_dir in src_dirs:
-    for path, dnames, fnames in os.walk(src_dir):
-      for fname in fnames:
-        ret.append(os.path.join(path, fname).replace(strip, ""))
-  return ret
-
-os.chdir(os.path.dirname(os.path.abspath(__file__)))
-setup(
-  name = "shell",
-  version = VERSION,
-  url = 'http://github.com/cloudera/hue',
-  description = 'Shell interface in Hue',
-  author = 'Hue',
-  packages = find_packages('src'),
-  package_dir = {'': 'src'},
-  install_requires = ['setuptools', 'desktop'],
-  entry_points = { 'desktop.sdk.application': 'shell=shell' },
-  zip_safe = False,
-  package_data = {
-    # Include static resources.  Package_data doesn't
-    # deal well with directory globs, so we enumerate
-    # the files manually.
-    'shell': expand_package_data(
-      ["src/shell/templates", "src/shell/static"],
-      "src/shell/")
-  }
-)

+ 0 - 2
apps/shell/src/shell/.gitignore

@@ -1,2 +0,0 @@
-# Build product
-/setuid

+ 0 - 29
apps/shell/src/shell/Makefile

@@ -1,29 +0,0 @@
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. 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.
-
-CC := gcc
-CFLAGS := -Werror -Wall
-DESTDIR := build
-
-default: $(DESTDIR)/setuid
-
-$(DESTDIR)/setuid: setuid.c
-	mkdir -p $(@D)
-	$(CC) $(CFLAGS) $< -o $@
-	chmod 4711 $@
-
-clean:
-	rm -rf $(DESTDIR)

+ 0 - 15
apps/shell/src/shell/__init__.py

@@ -1,15 +0,0 @@
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. 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.

+ 0 - 108
apps/shell/src/shell/conf.py

@@ -1,108 +0,0 @@
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. 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 options for the Shell UI.
-This file specifies the structure that the shell configuration should follow.
-See conf/hue.ini to configure which shells are available.
-"""
-from desktop.lib.conf import Config, ConfigSection, UnspecifiedConfigSection
-import shell.utils as utils
-
-SHELL_TYPES = UnspecifiedConfigSection(
-  key='shelltypes',
-  each=ConfigSection(
-    members=dict(
-      nice_name=Config(
-        key='nice_name',
-        required=True
-      ),
-      command=Config(
-        key='command',
-        required=True
-      ),
-      help_doc=Config(
-        key='help',
-        required=False
-      ),
-      environment=UnspecifiedConfigSection(
-        key='environment',
-        each=ConfigSection(
-          members=dict(
-            value=Config(
-              key='value',
-              required=True
-            ),
-            doc=Config(
-              key='doc',
-              required=False
-            )
-          )
-        )
-      )
-    )
-  )
-)
-
-SHELL_BUFFER_AMOUNT = Config(
-  key="shell_buffer_amount",
-  help="Configure the number of output characters buffered for each shell",
-  default=524288,
-  type=int
-)
-
-SHELL_TIMEOUT = Config(
-  key="shell_timeout",
-  help="Number of seconds to keep shells open for users",
-  default=600,
-  type=int
-)
-
-SHELL_WRITE_BUFFER_LIMIT = Config(
-  key="shell_write_buffer_limit",
-  help="Number of bytes of commands to buffer for users",
-  default=10000,
-  type=int
-)
-
-SHELL_OS_READ_AMOUNT = Config(
-  key="shell_os_read_amount",
-  help="Number of bytes to read from child subprocess at a time",
-  default=40960,
-  type=int
-)
-
-SHELL_DELEGATION_TOKEN_DIR = Config(
-  key="shell_delegation_token_dir",
-  help="The directory to store the temporary delegation tokens used by shell subprocesses",
-  default="/tmp/hue_shell_delegation_tokens",
-  type=str
-)
-
-def config_validator(user):
-  """
-  config_validator() -> [ (config_variable, error_message) ]
-
-  Called by core check_config() view.
-  """
-  result = []
-  for item in SHELL_TYPES.keys():
-    command = SHELL_TYPES[item].command.get().strip().split()
-    nice_name = SHELL_TYPES[item].nice_name.get().strip()
-    if not utils.executable_exists(command):
-      result.append((SHELL_TYPES, "Command '%s' for entry '%s' in Shell app configuration cannot \
-                                            be found on the path." % (' '.join(command), item,) ,))
-  return result
-

+ 0 - 59
apps/shell/src/shell/constants.py

@@ -1,59 +0,0 @@
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. 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.
-
-"""
-A file to store all the constants in one place. Most constants
-are the members of JSON objects, which are stored here for
-easy reference.
-"""
-
-SHELL_ID = "shellId"
-NOT_LOGGED_IN = "notLoggedIn"
-SHELL_KILLED = "shellKilled"
-SUCCESS = "success"
-
-
-# Parameter/JSON object member names
-ALIVE = "alive"
-EXITED = "exited"
-OUTPUT = "output"
-COMMAND = "lineToSend"
-COMMANDS = "commands"
-KEY_NAME = "keyName"
-NICE_NAME = "niceName"
-OFFSET = "offset"
-NEXT_OFFSET = "nextOffset"
-NO_SHELL_EXISTS = "noShellExists"
-BUFFER_EXCEEDED = "bufferExceeded"
-PERIODIC_RESPONSE = "periodicResponse"
-SHELL_CREATE_FAILED = "shellCreateFailed"
-MORE_OUTPUT_AVAILABLE = "moreOutputAvailable"
-NUM_PAIRS = "numPairs"
-CANCELLED = "cancelled"
-NOT_RUNNING_SPAWNING = "notRunningSpawning"
-IS_TAB = "isTab"
-NO_SUCH_USER = "noSuchUser"
-SHELL_NOT_ALLOWED = "shellNotAllowed"
-HOME = "HOME"
-HADOOP_HOME = "HADOOP_HOME"
-HADOOP_MAPRED_HOME = "HADOOP_MAPRED_HOME"
-HADOOP_TOKEN_FILE_LOCATION = 'HADOOP_TOKEN_FILE_LOCATION'
-EXISTS = "exists"
-
-# HTTP Headers used
-HUE_INSTANCE_ID = "HTTP_HUE_INSTANCE_ID"
-
-BROWSER_REQUEST_TIMEOUT = 55    # seconds

+ 0 - 15
apps/shell/src/shell/forms.py

@@ -1,15 +0,0 @@
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. 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.

+ 0 - 78
apps/shell/src/shell/locale/de/LC_MESSAGES/django.po

@@ -1,78 +0,0 @@
-# German translations for Hue.
-# Copyright (C) 2012 Cloudera
-# This file is distributed under the same license as the Hue project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2013-07-15 18:44-0700\n"
-"PO-Revision-Date: 2012-07-30 18:56-0700\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: de <LL@li.org>\n"
-"Plural-Forms: nplurals=2; plural=(n != 1)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 0.9.6\n"
-
-#: src/shell/shellmanager.py:156
-#, python-format
-msgid "bin/hadoop return non-zero %(retcode)d while trying to merge credentials."
-msgstr "bin/hadoop gibt Nicht-Null %(retcode)d zurück beim Versuch, Benutzerinformationen zusammenzuführen."
-
-#: src/shell/templates/failed_to_create.mako:21
-#: src/shell/templates/no_such_user.mako:21
-#: src/shell/templates/not_running_spawning.mako:21
-msgid "Error"
-msgstr "Fehler"
-
-#: src/shell/templates/failed_to_create.mako:24
-msgid "Failed to create a shell of the given type. The possible reasons for this are:"
-msgstr "Eine Shell des gegebenen Typs konnte nicht erstellt werden. Die möglichen Gründe dafür sind:"
-
-#: src/shell/templates/failed_to_create.mako:26
-msgid "The system is out of PTYs."
-msgstr "Das System hat keine PTYs mehr."
-
-#: src/shell/templates/failed_to_create.mako:27
-msgid "The system cannot create more subprocesses."
-msgstr "Das System kann keine weiteren Subprozesse erstellen."
-
-#: src/shell/templates/failed_to_create.mako:28
-msgid "You do not have permission to create shells of this type."
-msgstr "Sie haben nicht die erforderlichen Rechte, um Shells dieser Art zu erstellen."
-
-#: src/shell/templates/failed_to_create.mako:29
-msgid "There is no shell with that name."
-msgstr "Es gibt keine Shell mit diesem Namen."
-
-#: src/shell/templates/failed_to_create.mako:30
-msgid "There is no Unix user account for you."
-msgstr "Es gibt kein Unix-Benutzerkonto für Sie."
-
-#: src/shell/templates/index.mako:86
-msgid "Select one of the available shells from the toolbar above."
-msgstr "Wählen Sie eine der verfügbaren Shells aus der Symbolleiste oben aus."
-
-#: src/shell/templates/index.mako:88
-msgid "You do not have permission to access any shell or there is no configured shell."
-msgstr "Sie haben nicht die erforderlichen Rechte, um auf eine Shell zuzugreifen, oder es gibt keine konfigurierte Shell."
-
-#: src/shell/templates/index.mako:97
-msgid "The shell is not present on the Hue host."
-msgstr "Die Shell ist auf dem Hue-Host nicht vorhanden."
-
-#: src/shell/templates/no_such_user.mako:24
-msgid "The Shell application requires a Unix user account for every user of Hue on the remote web server."
-msgstr "Die Shell-Anwendung erfordert ein Unix-Benutzerkonto für jeden Benutzer von Hue auf dem Remote-Webserver."
-
-#: src/shell/templates/no_such_user.mako:26
-msgid "Ask your administrator to create a user account for you on the remote web server as described in the Shell documentation."
-msgstr "Bitten Sie Ihren Administrator, für Sie ein Benutzerkonto auf dem Remote-Webserver zu erstellen, wie in der Shell-Dokumentation beschrieben."
-
-#: src/shell/templates/not_running_spawning.mako:24
-msgid "The webserver currently running Hue does not support the Shell application. Please contact your administrator."
-msgstr "Der Webserver, auf dem derzeit Hue ausgeführt wird, unterstützt die Shell-Anwendung nicht. Wenden Sie sich an Ihren Administrator."
-

+ 0 - 88
apps/shell/src/shell/locale/en_US.pot

@@ -1,88 +0,0 @@
-# Translations template for Hue.
-# Copyright (C) 2013 Cloudera, Inc
-# This file is distributed under the same license as the Hue project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: Hue VERSION\n"
-"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2013-05-10 11:59-0700\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 0.9.6\n"
-
-#: src/shell/shellmanager.py:156
-#, python-format
-msgid "bin/hadoop return non-zero %(retcode)d while trying to merge credentials."
-msgstr ""
-
-#: src/shell/templates/failed_to_create.mako:21
-#: src/shell/templates/index.mako:22 src/shell/templates/no_such_user.mako:21
-#: src/shell/templates/not_running_spawning.mako:21
-msgid "Hue Shell"
-msgstr ""
-
-#: src/shell/templates/failed_to_create.mako:24
-msgid ""
-"Failed to create a shell of the given type. The possible reasons for this"
-" are:"
-msgstr ""
-
-#: src/shell/templates/failed_to_create.mako:26
-msgid "The system is out of PTYs."
-msgstr ""
-
-#: src/shell/templates/failed_to_create.mako:27
-msgid "The system cannot create more subprocesses."
-msgstr ""
-
-#: src/shell/templates/failed_to_create.mako:28
-msgid "You do not have permission to create shells of this type."
-msgstr ""
-
-#: src/shell/templates/failed_to_create.mako:29
-msgid "There is no shell with that name."
-msgstr ""
-
-#: src/shell/templates/failed_to_create.mako:30
-msgid "There is no Unix user account for you."
-msgstr ""
-
-#: src/shell/templates/index.mako:86
-msgid "Select one of the available shells from the toolbar above."
-msgstr ""
-
-#: src/shell/templates/index.mako:88
-msgid ""
-"You do not have permission to access any shell or there is no configured "
-"shell."
-msgstr ""
-
-#: src/shell/templates/index.mako:97
-msgid "The shell is not present on the Hue host."
-msgstr ""
-
-#: src/shell/templates/no_such_user.mako:24
-msgid ""
-"The Shell application requires a Unix user account for every user of Hue "
-"on the remote web server."
-msgstr ""
-
-#: src/shell/templates/no_such_user.mako:26
-msgid ""
-"Ask your administrator to create a user account for you on the remote web"
-" server as described in the Shell documentation."
-msgstr ""
-
-#: src/shell/templates/not_running_spawning.mako:24
-msgid ""
-"The webserver currently running Hue does not support the Shell "
-"application. Please contact your administrator."
-msgstr ""
-

+ 0 - 78
apps/shell/src/shell/locale/es/LC_MESSAGES/django.po

@@ -1,78 +0,0 @@
-# Spanish translations for Hue.
-# Copyright (C) 2012 Cloudera
-# This file is distributed under the same license as the Hue project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2013-07-15 18:44-0700\n"
-"PO-Revision-Date: 2012-07-30 18:56-0700\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: es <LL@li.org>\n"
-"Plural-Forms: nplurals=2; plural=(n != 1)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 0.9.6\n"
-
-#: src/shell/shellmanager.py:156
-#, python-format
-msgid "bin/hadoop return non-zero %(retcode)d while trying to merge credentials."
-msgstr "bin/hadoop devuelve %(retcode)d que no es cero al intentar fusionar credenciales."
-
-#: src/shell/templates/failed_to_create.mako:21
-#: src/shell/templates/no_such_user.mako:21
-#: src/shell/templates/not_running_spawning.mako:21
-msgid "Error"
-msgstr "Error"
-
-#: src/shell/templates/failed_to_create.mako:24
-msgid "Failed to create a shell of the given type. The possible reasons for this are:"
-msgstr "Error al crear un shell del tipo determinado. Las posibles razones de esto son:"
-
-#: src/shell/templates/failed_to_create.mako:26
-msgid "The system is out of PTYs."
-msgstr "El sistema no tiene PTY suficientes."
-
-#: src/shell/templates/failed_to_create.mako:27
-msgid "The system cannot create more subprocesses."
-msgstr "El sistema no puede crear más subprocesos."
-
-#: src/shell/templates/failed_to_create.mako:28
-msgid "You do not have permission to create shells of this type."
-msgstr "No tiene permiso para crear shells de este tipo."
-
-#: src/shell/templates/failed_to_create.mako:29
-msgid "There is no shell with that name."
-msgstr "No hay ningún shell con ese nombre."
-
-#: src/shell/templates/failed_to_create.mako:30
-msgid "There is no Unix user account for you."
-msgstr "No hay ninguna cuenta de usuario de Unix para usted."
-
-#: src/shell/templates/index.mako:86
-msgid "Select one of the available shells from the toolbar above."
-msgstr "Seleccione uno de los shells disponibles de la barra de herramientas anterior."
-
-#: src/shell/templates/index.mako:88
-msgid "You do not have permission to access any shell or there is no configured shell."
-msgstr "No tiene permiso para acceder a ningún shell o no hay ningún shell configurado."
-
-#: src/shell/templates/index.mako:97
-msgid "The shell is not present on the Hue host."
-msgstr "El shell no está presente en el host de Hue."
-
-#: src/shell/templates/no_such_user.mako:24
-msgid "The Shell application requires a Unix user account for every user of Hue on the remote web server."
-msgstr "La aplicación del shell necesita una cuenta de usuario de Unix para todos los usuarios de Hue en el servidor web remoto."
-
-#: src/shell/templates/no_such_user.mako:26
-msgid "Ask your administrator to create a user account for you on the remote web server as described in the Shell documentation."
-msgstr "Solicite al administrador que cree una cuenta de usuario para usted en el servidor web remoto como se describe en la documentación del shell."
-
-#: src/shell/templates/not_running_spawning.mako:24
-msgid "The webserver currently running Hue does not support the Shell application. Please contact your administrator."
-msgstr "El servidor web que actualmente ejecuta Hue no es compatible con la aplicación del shell. Póngase en contacto con su administrador."
-

+ 0 - 78
apps/shell/src/shell/locale/fr/LC_MESSAGES/django.po

@@ -1,78 +0,0 @@
-# French translations for Hue.
-# Copyright (C) 2012 Cloudera
-# This file is distributed under the same license as the Hue project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2013-07-15 18:44-0700\n"
-"PO-Revision-Date: 2012-07-30 18:56-0700\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: fr <LL@li.org>\n"
-"Plural-Forms: nplurals=2; plural=(n > 1)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 0.9.6\n"
-
-#: src/shell/shellmanager.py:156
-#, python-format
-msgid "bin/hadoop return non-zero %(retcode)d while trying to merge credentials."
-msgstr "bin/hadoop renvoient %(retcode)d différent de zéro lors de la tentative de fusion des informations de connexion."
-
-#: src/shell/templates/failed_to_create.mako:21
-#: src/shell/templates/no_such_user.mako:21
-#: src/shell/templates/not_running_spawning.mako:21
-msgid "Error"
-msgstr "Erreur"
-
-#: src/shell/templates/failed_to_create.mako:24
-msgid "Failed to create a shell of the given type. The possible reasons for this are:"
-msgstr "Echec de création d'un shell du type donné. Raisons possibles de cet échec :"
-
-#: src/shell/templates/failed_to_create.mako:26
-msgid "The system is out of PTYs."
-msgstr "Le système manque de PTY."
-
-#: src/shell/templates/failed_to_create.mako:27
-msgid "The system cannot create more subprocesses."
-msgstr "Le système ne peut pas créer d'autres sous-processus."
-
-#: src/shell/templates/failed_to_create.mako:28
-msgid "You do not have permission to create shells of this type."
-msgstr "Vous n'êtes pas autorisé à créer des shells de ce type."
-
-#: src/shell/templates/failed_to_create.mako:29
-msgid "There is no shell with that name."
-msgstr "Aucun shell ne porte ce nom."
-
-#: src/shell/templates/failed_to_create.mako:30
-msgid "There is no Unix user account for you."
-msgstr "Aucun compte utilisateur Unix ne vous a été attribué."
-
-#: src/shell/templates/index.mako:86
-msgid "Select one of the available shells from the toolbar above."
-msgstr "Sélectionnez l'un des shells disponibles dans la barre d'outils ci-dessus."
-
-#: src/shell/templates/index.mako:88
-msgid "You do not have permission to access any shell or there is no configured shell."
-msgstr "Vous n'êtes pas autorisé à accéder à un shell, ou aucun shell n'est configuré."
-
-#: src/shell/templates/index.mako:97
-msgid "The shell is not present on the Hue host."
-msgstr "Absence de Shell sur l'hôte Hue."
-
-#: src/shell/templates/no_such_user.mako:24
-msgid "The Shell application requires a Unix user account for every user of Hue on the remote web server."
-msgstr "L'application Shell nécessite un compte utilisateur Unix pour chaque utilisateur Hue sur le serveur Web distant."
-
-#: src/shell/templates/no_such_user.mako:26
-msgid "Ask your administrator to create a user account for you on the remote web server as described in the Shell documentation."
-msgstr "Demandez à votre administrateur de vous créer un compte utilisateur sur le serveur Web distant comme décrit dans la documentation du Shell."
-
-#: src/shell/templates/not_running_spawning.mako:24
-msgid "The webserver currently running Hue does not support the Shell application. Please contact your administrator."
-msgstr "Le serveur Web qui exécute actuellement Hue ne prend pas en charge l'application Shell. Veuillez contacter votre administrateur."
-

+ 0 - 78
apps/shell/src/shell/locale/ja/LC_MESSAGES/django.po

@@ -1,78 +0,0 @@
-# Japanese translations for Hue.
-# Copyright (C) 2012 Cloudera
-# This file is distributed under the same license as the Hue project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2013-07-15 18:44-0700\n"
-"PO-Revision-Date: 2012-07-30 18:56-0700\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: ja <LL@li.org>\n"
-"Plural-Forms: nplurals=1; plural=0\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 0.9.6\n"
-
-#: src/shell/shellmanager.py:156
-#, python-format
-msgid "bin/hadoop return non-zero %(retcode)d while trying to merge credentials."
-msgstr "bin/hadoop は、資格情報をマージしようとしている間に、ゼロではない %(retcode)d を返します。"
-
-#: src/shell/templates/failed_to_create.mako:21
-#: src/shell/templates/no_such_user.mako:21
-#: src/shell/templates/not_running_spawning.mako:21
-msgid "Error"
-msgstr "エラー"
-
-#: src/shell/templates/failed_to_create.mako:24
-msgid "Failed to create a shell of the given type. The possible reasons for this are:"
-msgstr "指定されたタイプのシェルを作成できませんでした。考えられる原因は次のとおりです。"
-
-#: src/shell/templates/failed_to_create.mako:26
-msgid "The system is out of PTYs."
-msgstr "システムが PTY 外です。"
-
-#: src/shell/templates/failed_to_create.mako:27
-msgid "The system cannot create more subprocesses."
-msgstr "サブプロセスをこれ以上作成できません。"
-
-#: src/shell/templates/failed_to_create.mako:28
-msgid "You do not have permission to create shells of this type."
-msgstr "このタイプのシェルを作成するパーミッションがありません。"
-
-#: src/shell/templates/failed_to_create.mako:29
-msgid "There is no shell with that name."
-msgstr "指定された名前のシェルがありません。"
-
-#: src/shell/templates/failed_to_create.mako:30
-msgid "There is no Unix user account for you."
-msgstr "使用できる UNIX ユーザーアカウントがありません。"
-
-#: src/shell/templates/index.mako:86
-msgid "Select one of the available shells from the toolbar above."
-msgstr "上のツールバーにある使用可能なシェルの中から 1 つ選択してください。"
-
-#: src/shell/templates/index.mako:88
-msgid "You do not have permission to access any shell or there is no configured shell."
-msgstr "どのシェルにもアクセスするパーミッションがないか、シェルが 1 つも設定されていません。"
-
-#: src/shell/templates/index.mako:97
-msgid "The shell is not present on the Hue host."
-msgstr "シェルが Hue ホストに存在しません。"
-
-#: src/shell/templates/no_such_user.mako:24
-msgid "The Shell application requires a Unix user account for every user of Hue on the remote web server."
-msgstr "このシェルアプリケーションでは、リモート Web サーバー上にある Hue のすべてのユーザーに Unix のユーザーアカウントが必要です。"
-
-#: src/shell/templates/no_such_user.mako:26
-msgid "Ask your administrator to create a user account for you on the remote web server as described in the Shell documentation."
-msgstr "シェルのマニュアルに従ってリモート Web サーバー上にユーザーアカウントを作成することを担当の管理者に依頼してください。"
-
-#: src/shell/templates/not_running_spawning.mako:24
-msgid "The webserver currently running Hue does not support the Shell application. Please contact your administrator."
-msgstr "現在 Hue を実行している Web サーバーは、Shell アプリケーションをサポートしていません。管理者に問い合わせてください。"
-

+ 0 - 78
apps/shell/src/shell/locale/ko/LC_MESSAGES/django.po

@@ -1,78 +0,0 @@
-# Korean translations for Hue.
-# Copyright (C) 2012 Cloudera
-# This file is distributed under the same license as the Hue project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2013-07-15 18:44-0700\n"
-"PO-Revision-Date: 2012-07-30 18:56-0700\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: ko <LL@li.org>\n"
-"Plural-Forms: nplurals=1; plural=0\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 0.9.6\n"
-
-#: src/shell/shellmanager.py:156
-#, python-format
-msgid "bin/hadoop return non-zero %(retcode)d while trying to merge credentials."
-msgstr "자격 증명을 병합하는 동안 bin/hadoop이 0이 아닌 값 %(retcode)d을(를) 반환했습니다."
-
-#: src/shell/templates/failed_to_create.mako:21
-#: src/shell/templates/no_such_user.mako:21
-#: src/shell/templates/not_running_spawning.mako:21
-msgid "Error"
-msgstr "오류"
-
-#: src/shell/templates/failed_to_create.mako:24
-msgid "Failed to create a shell of the given type. The possible reasons for this are:"
-msgstr "주어진 유형의 Shell을 생성하지 못했습니다. 가능한 원인:"
-
-#: src/shell/templates/failed_to_create.mako:26
-msgid "The system is out of PTYs."
-msgstr "이 시스템이 PTY 밖에 있습니다."
-
-#: src/shell/templates/failed_to_create.mako:27
-msgid "The system cannot create more subprocesses."
-msgstr "이 시스템은 추가 하위 프로세스를 생성할 수 없습니다."
-
-#: src/shell/templates/failed_to_create.mako:28
-msgid "You do not have permission to create shells of this type."
-msgstr "이 유형의 Shell을 생성할 권한이 없습니다."
-
-#: src/shell/templates/failed_to_create.mako:29
-msgid "There is no shell with that name."
-msgstr "이 이름을 갖는 Shell이 없습니다."
-
-#: src/shell/templates/failed_to_create.mako:30
-msgid "There is no Unix user account for you."
-msgstr "귀하의 Unix 사용자 계정이 없습니다."
-
-#: src/shell/templates/index.mako:86
-msgid "Select one of the available shells from the toolbar above."
-msgstr "위 도구 모음에서 사용 가능한 Shell 하나를 선택하십시오."
-
-#: src/shell/templates/index.mako:88
-msgid "You do not have permission to access any shell or there is no configured shell."
-msgstr "Shell에 대한 액세스 권한이 없거나 구성된 Shell이 없습니다."
-
-#: src/shell/templates/index.mako:97
-msgid "The shell is not present on the Hue host."
-msgstr "Shell이 Hue 호스트에 없습니다."
-
-#: src/shell/templates/no_such_user.mako:24
-msgid "The Shell application requires a Unix user account for every user of Hue on the remote web server."
-msgstr "Shell 애플리케이션에서는 원격 웹 서버에 있는 Hue의 모든 사용자에 대한  Unix 사용자 계정이 필요합니다."
-
-#: src/shell/templates/no_such_user.mako:26
-msgid "Ask your administrator to create a user account for you on the remote web server as described in the Shell documentation."
-msgstr "Shell 설명서에 나와 있는 대로 관리자에게 원격 웹 서버에 대한 사용자 계정을 생성해주도록 요청하십시오."
-
-#: src/shell/templates/not_running_spawning.mako:24
-msgid "The webserver currently running Hue does not support the Shell application. Please contact your administrator."
-msgstr "현재 Hue를 실행하는 웹 서버가 Shell 애플리케이션을 지원하지 않습니다. 관리자에게 문의하십시오."
-

+ 0 - 78
apps/shell/src/shell/locale/pt/LC_MESSAGES/django.po

@@ -1,78 +0,0 @@
-# Portuguese translations for Hue.
-# Copyright (C) 2012 Cloudera
-# This file is distributed under the same license as the Hue project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2013-07-15 18:44-0700\n"
-"PO-Revision-Date: 2012-07-30 18:56-0700\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: pt <LL@li.org>\n"
-"Plural-Forms: nplurals=2; plural=(n != 1)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 0.9.6\n"
-
-#: src/shell/shellmanager.py:156
-#, python-format
-msgid "bin/hadoop return non-zero %(retcode)d while trying to merge credentials."
-msgstr "bin/hadoop devolveu %(retcode)d não zero ao tentar unir credenciais."
-
-#: src/shell/templates/failed_to_create.mako:21
-#: src/shell/templates/no_such_user.mako:21
-#: src/shell/templates/not_running_spawning.mako:21
-msgid "Error"
-msgstr "Erro"
-
-#: src/shell/templates/failed_to_create.mako:24
-msgid "Failed to create a shell of the given type. The possible reasons for this are:"
-msgstr "Falha ao criar uma shell do tipo indicado. Os motivos possíveis para tal são:"
-
-#: src/shell/templates/failed_to_create.mako:26
-msgid "The system is out of PTYs."
-msgstr "O sistema já não tem mais PTYs."
-
-#: src/shell/templates/failed_to_create.mako:27
-msgid "The system cannot create more subprocesses."
-msgstr "O sistema não pode criar mais subprocessos."
-
-#: src/shell/templates/failed_to_create.mako:28
-msgid "You do not have permission to create shells of this type."
-msgstr "Não tem permissão para criar shells deste tipo."
-
-#: src/shell/templates/failed_to_create.mako:29
-msgid "There is no shell with that name."
-msgstr "Não existe uma shell com o nome indicado."
-
-#: src/shell/templates/failed_to_create.mako:30
-msgid "There is no Unix user account for you."
-msgstr "Não existe qualquer conta de utilizador de Unix associada a si."
-
-#: src/shell/templates/index.mako:86
-msgid "Select one of the available shells from the toolbar above."
-msgstr "Seleccione uma das shells disponíveis na barra de ferramentas acima."
-
-#: src/shell/templates/index.mako:88
-msgid "You do not have permission to access any shell or there is no configured shell."
-msgstr "Não tem permissão para aceder a qualquer shell ou não existe qualquer shell configurada."
-
-#: src/shell/templates/index.mako:97
-msgid "The shell is not present on the Hue host."
-msgstr "A shell não está presente no anfitrião do Hue."
-
-#: src/shell/templates/no_such_user.mako:24
-msgid "The Shell application requires a Unix user account for every user of Hue on the remote web server."
-msgstr "A aplicação Shell requer uma conta de utilizador Unix para cada utilizador da Hue no servidor web remoto."
-
-#: src/shell/templates/no_such_user.mako:26
-msgid "Ask your administrator to create a user account for you on the remote web server as described in the Shell documentation."
-msgstr "Solicite ao seu administrador que lhe crie uma conta de utilizador no servidor web remoto, conforme descrito na documentação da Shell."
-
-#: src/shell/templates/not_running_spawning.mako:24
-msgid "The webserver currently running Hue does not support the Shell application. Please contact your administrator."
-msgstr "O servidor de Internet que está a executar actualmente o Hue não suporta a aplicação Shell. Contacte o seu administrador."
-

+ 0 - 78
apps/shell/src/shell/locale/pt_BR/LC_MESSAGES/django.po

@@ -1,78 +0,0 @@
-# Portuguese (Brazil) translations for Hue.
-# Copyright (C) 2012 Cloudera
-# This file is distributed under the same license as the Hue project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2013-07-15 18:44-0700\n"
-"PO-Revision-Date: 2012-07-30 18:56-0700\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: pt_BR <LL@li.org>\n"
-"Plural-Forms: nplurals=2; plural=(n > 1)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 0.9.6\n"
-
-#: src/shell/shellmanager.py:156
-#, python-format
-msgid "bin/hadoop return non-zero %(retcode)d while trying to merge credentials."
-msgstr "Retorno do bin/hadoop %(retcode)d diferente de zero enquanto tenta mesclar credenciais."
-
-#: src/shell/templates/failed_to_create.mako:21
-#: src/shell/templates/no_such_user.mako:21
-#: src/shell/templates/not_running_spawning.mako:21
-msgid "Error"
-msgstr "Erro"
-
-#: src/shell/templates/failed_to_create.mako:24
-msgid "Failed to create a shell of the given type. The possible reasons for this are:"
-msgstr "Falha ao criar um programa shell de determinado tipo. As razões possíveis são:"
-
-#: src/shell/templates/failed_to_create.mako:26
-msgid "The system is out of PTYs."
-msgstr "O sistema está fora do PTYs."
-
-#: src/shell/templates/failed_to_create.mako:27
-msgid "The system cannot create more subprocesses."
-msgstr "O sistema não pode criar mais subprocessos."
-
-#: src/shell/templates/failed_to_create.mako:28
-msgid "You do not have permission to create shells of this type."
-msgstr "Você não tem permissão para criar shells deste tipo."
-
-#: src/shell/templates/failed_to_create.mako:29
-msgid "There is no shell with that name."
-msgstr "Não existe shell para aquele nome."
-
-#: src/shell/templates/failed_to_create.mako:30
-msgid "There is no Unix user account for you."
-msgstr "Não existe conta de usuário Unix para você."
-
-#: src/shell/templates/index.mako:86
-msgid "Select one of the available shells from the toolbar above."
-msgstr "Selecione um dos shells disponíveis na barra de ferramentas acima."
-
-#: src/shell/templates/index.mako:88
-msgid "You do not have permission to access any shell or there is no configured shell."
-msgstr "Você não tem permissão para acessar qualquer shell ou não existe um shell configurado."
-
-#: src/shell/templates/index.mako:97
-msgid "The shell is not present on the Hue host."
-msgstr "O shell não está presente no host do Hue."
-
-#: src/shell/templates/no_such_user.mako:24
-msgid "The Shell application requires a Unix user account for every user of Hue on the remote web server."
-msgstr "O aplicativo Shell necessita de uma conta de usuário Unix para cada usuário do Hue no servidor Web remoto."
-
-#: src/shell/templates/no_such_user.mako:26
-msgid "Ask your administrator to create a user account for you on the remote web server as described in the Shell documentation."
-msgstr "Peça a seu administrador para criar uma conta de usuário para você no servidor Web remoto conforme descrito na documentação do shell."
-
-#: src/shell/templates/not_running_spawning.mako:24
-msgid "The webserver currently running Hue does not support the Shell application. Please contact your administrator."
-msgstr "O servidor da Web que atualmente executa o Hue não oferece suporte ao aplicativo Shell. Entre em contato com o seu administrador."
-

+ 0 - 78
apps/shell/src/shell/locale/zh_CN/LC_MESSAGES/django.po

@@ -1,78 +0,0 @@
-# Chinese (China) translations for Hue.
-# Copyright (C) 2012 Cloudera
-# This file is distributed under the same license as the Hue project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2013-07-15 18:44-0700\n"
-"PO-Revision-Date: 2012-07-30 18:56-0700\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: zh_CN <LL@li.org>\n"
-"Plural-Forms: nplurals=1; plural=0\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 0.9.6\n"
-
-#: src/shell/shellmanager.py:156
-#, python-format
-msgid "bin/hadoop return non-zero %(retcode)d while trying to merge credentials."
-msgstr "尝试合并凭据期间,bin/hadoop 返回了非零 %(retcode)d。"
-
-#: src/shell/templates/failed_to_create.mako:21
-#: src/shell/templates/no_such_user.mako:21
-#: src/shell/templates/not_running_spawning.mako:21
-msgid "Error"
-msgstr "错误"
-
-#: src/shell/templates/failed_to_create.mako:24
-msgid "Failed to create a shell of the given type. The possible reasons for this are:"
-msgstr "无法创建给定类型的 shell。造成这种情况的原因可能是:"
-
-#: src/shell/templates/failed_to_create.mako:26
-msgid "The system is out of PTYs."
-msgstr "系统已超出 PTY。"
-
-#: src/shell/templates/failed_to_create.mako:27
-msgid "The system cannot create more subprocesses."
-msgstr "系统无法创建更多子进程。"
-
-#: src/shell/templates/failed_to_create.mako:28
-msgid "You do not have permission to create shells of this type."
-msgstr "您无权创建此类型的 shell。"
-
-#: src/shell/templates/failed_to_create.mako:29
-msgid "There is no shell with that name."
-msgstr "不存在该名称的 shell。"
-
-#: src/shell/templates/failed_to_create.mako:30
-msgid "There is no Unix user account for you."
-msgstr "您没有 Unix 用户帐户。"
-
-#: src/shell/templates/index.mako:86
-msgid "Select one of the available shells from the toolbar above."
-msgstr "请从上面的工具栏中选择其中一个可用的 shell。"
-
-#: src/shell/templates/index.mako:88
-msgid "You do not have permission to access any shell or there is no configured shell."
-msgstr "您无权访问任何 shell,或者不存在配置 shell。"
-
-#: src/shell/templates/index.mako:97
-msgid "The shell is not present on the Hue host."
-msgstr "在 Hue 主机上不存在 shell。"
-
-#: src/shell/templates/no_such_user.mako:24
-msgid "The Shell application requires a Unix user account for every user of Hue on the remote web server."
-msgstr "对于远程 Web 服务器上的每个 Hue 用户,Shell 应用程序都需要一个 Unix 用户帐户。"
-
-#: src/shell/templates/no_such_user.mako:26
-msgid "Ask your administrator to create a user account for you on the remote web server as described in the Shell documentation."
-msgstr "请要求您的管理员根据 Shell 文档中的描述,为您在远程 Web 服务器上创建一个用户帐户。"
-
-#: src/shell/templates/not_running_spawning.mako:24
-msgid "The webserver currently running Hue does not support the Shell application. Please contact your administrator."
-msgstr "当前正在运行 Hue 的 Web 服务器不支持 Shell 应用程序。请与您的管理员联系。"
-

+ 0 - 15
apps/shell/src/shell/models.py

@@ -1,15 +0,0 @@
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. 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.

+ 0 - 28
apps/shell/src/shell/settings.py

@@ -1,28 +0,0 @@
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. 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.
-DJANGO_APPS = [ "shell" ]
-REQUIRES_HADOOP = False
-
-NICE_NAME = "Hue Shell"
-PERMISSION_ACTIONS = (
-  ("launch_pig", "Launch the Pig Shell"),
-  ("launch_flume", "Launch the Flume Shell"),
-  ("launch_hbase", "Launch the HBase Shell"),
-  ("launch_sqoop2", "Launch the Sqoop2 Shell"),
-)
-
-ICON = "/shell/static/art/icon_shell_24.png"
-MENU_INDEX = 50

+ 0 - 228
apps/shell/src/shell/setuid.c

@@ -1,228 +0,0 @@
-/*
- Licensed to Cloudera, Inc. under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  Cloudera, Inc. 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.
-*/
-
-#include <errno.h>
-#include <grp.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <limits.h>
-#include <sys/stat.h>
-
-static int min_uid = 500;
-
-void log_error(const char *format, ...) {
-  va_list args;
-  va_start(args, format);
-  vfprintf(stderr, format, args);
-  va_end(args);
-  fprintf(stderr, "\n");
-}
-
-/**
- * Gets the name of the currently executing binary. The caller is responsible for freeing
- * the returned pointer.
- */
-char *get_executable_name() {
-  char buffer[PATH_MAX];
-  snprintf(buffer, PATH_MAX, "/proc/%u/exe", getpid());
-
-  char *filename = (char *) calloc(1, PATH_MAX);
-  if (filename == NULL) {
-    log_error("Error: calloc returned null, system out of memory.");
-    return NULL;
-  }
-
-  ssize_t len = readlink(buffer, filename, PATH_MAX);
-  if (len == -1) {
-    log_error("Can't get executable name from \"%s\": %s", buffer, strerror(errno));
-    free(filename);
-    return NULL;
-  }
-
-  if (len >= PATH_MAX) {
-    log_error("Executable name %.*s is longer than %d characters.", PATH_MAX, filename, PATH_MAX);
-    free(filename);
-    return NULL;
-  }
-
-  return filename;
-}
-
-/**
- * Check the permissions on the setuid binary to make sure that security is
- * promisable. For this, we need the binary to
- *    * be user-owned by root
- *    * others do not have write permissions
- *    * be setuid
- */
-int check_binary_permissions() {
-
-  char *executable_file = get_executable_name();
-  if (executable_file == NULL) {
-    return -1;
-  }
-
-  struct stat filestat;
-  if (stat(executable_file, &filestat) != 0) {
-    log_error("Could not stat the executable %s : %s", executable_file, strerror(errno));
-    free(executable_file);
-    return -1;
-  }
-
-  // check others do not have write permissions
-  if ((filestat.st_mode & S_IWOTH) == S_IWOTH) {
-    log_error("The setuid binary should not be writable by others.");
-    free(executable_file);
-    return -1;
-  }
-
-  // Binary should be setuid executable
-  if ((filestat.st_mode & S_ISUID) == 0) {
-    log_error("The setuid binary should be set setuid.");
-    free(executable_file);
-    return -1;
-  }
-
-  free(executable_file);
-  return 0;
-}
-
-int chown_delegation_token_files(char *delegation_token_files, int uid, int gid) {
-  char *modifiable_delegation_token_files = strdup(delegation_token_files);
-  if (modifiable_delegation_token_files == NULL) {
-    log_error("Error: strdup returned NULL, system out of memory.");
-    return -1;
-  }
-
-  char *delegation_token_file = strtok(modifiable_delegation_token_files, ",");
-  while (delegation_token_file != NULL) {
-    int chown_result = chown(delegation_token_file, uid, gid);
-    if (chown_result != 0) {
-      log_error("Could not change ownership of file \"%s\" to UID %d and GID %d : %s", delegation_token_file, uid, gid, strerror(errno));
-      free(modifiable_delegation_token_files);
-      return -1;
-    }
-    delegation_token_file = strtok(NULL, ",");
-  }
-  free(modifiable_delegation_token_files);
-  return 0;
-}
-
-
-/**
- * Set the real/effective gid and uid.
- * This is a no-op if the current gid/uid are the same as what's asked for.
- */
-int set_gid_uid(int gid, int uid) {
-  if (getgid() != gid || getegid() != gid) {
-    gid_t group = gid;
-
-    if (setgroups(1, &group) != 0) {
-      log_error("Error: Could not set groups list to [%d] : %s", gid, strerror(errno));
-      return -1;
-    }
-
-    if (setregid(gid, gid) != 0) {
-      log_error("Error: Could not set real and effective group ID to %d : %s", gid, strerror(errno));
-      return -1;
-    }
-  }
-
-  if (getuid() != uid || geteuid() != uid) {
-    if (setreuid(uid, uid) != 0) {
-      log_error("Error: Could not set real and effective user ID to %d : %s", uid, strerror(errno));
-      return -1;
-    }
-  }
-
-  return 0;
-}
-
-int main(int argc, char **argv) {
-  
-  if (argc < 4){
-    log_error("Usage: setuid <desired user ID> <desired group ID> <executable> <arguments for executable>");
-    return -1;
-  }
-
-  // Because strtol can return the overflow/underflow error codes if it parses those integers correctly,
-  // we have to set errno to 0 before the call. The function will set errno to a non-zero value if an
-  // error occurs.
-  errno = 0;
-  int uid = strtol(argv[1], (char **)NULL, 10);
-  if (errno != 0) {
-    log_error("Error: Invalid value for UID: \"%s\" : %s", argv[1], strerror(errno));
-    return -1;
-  }
-
-  // See comment above for why we have to set errno to 0 before calling strtol.
-  errno = 0;
-  int gid = strtol(argv[2], (char **)NULL, 10);
-  if (errno != 0) {
-    log_error("Error: Invalid value for GID: \"%s\" : %s", argv[2], strerror(errno));
-    return -1;
-  }
-
-  if (uid < min_uid) {
-    log_error("Error: value %d for UID is less than the minimum UID allowed (%d)", uid, min_uid);
-    return -1;
-  }
-
-  if (check_binary_permissions() != 0) {
-    log_error("Error: permissions on setuid binary are not correct. Exiting.");
-    return -1;
-  }
-
-  char *delegation_token_files = getenv("HADOOP_TOKEN_FILE_LOCATION");
-  if (delegation_token_files != NULL) {
-    int chown_result = chown_delegation_token_files(delegation_token_files, uid, gid);
-    if (chown_result != 0) {
-      log_error("Error: Could not change ownership of delegation token files, exiting.");
-      return -1;
-    }
-  }
-
-  int set_gid_uid_result = set_gid_uid(gid, uid);
-  if (set_gid_uid_result != 0) {
-    log_error("Error: Could not correctly change to running as correct user, exiting.");
-    return -1;
-  }
-
-  int executable_index = 3;
-  const char *executable = argv[executable_index];
-  char **param_list = (char **) calloc(argc - executable_index + 1, sizeof(char *));
-
-  if (param_list == NULL) {
-    log_error("Error: calloc returned null, system out of memory.");
-    return -1;
-  }
-
-  int i;
-  for (i = 0; i < argc - executable_index; i++) {
-    param_list[i] = argv[executable_index + i];
-  }
-
-  int result = execvp(executable, param_list);
-
-  log_error("Error: exec returned %d with error: %s", result, strerror(errno));
-  return 0;
-}
-

+ 0 - 755
apps/shell/src/shell/shellmanager.py

@@ -1,755 +0,0 @@
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. 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.
-
-"""
-This module handles I/O with shells.  Much of the functionality has been pushed down into the
-Shell class itself, but a lot also happens in ShellManager.
-"""
-
-
-import cStringIO
-import errno
-import eventlet
-import hadoop.conf
-import logging
-import pty
-import pwd
-import shell.conf
-import shell.constants as constants
-import shell.utils as utils
-import signal
-import subprocess
-import tempfile
-import time
-import tty
-
-from eventlet.green import os
-from eventlet.green import select
-from eventlet.green import time
-from hadoop.cluster import all_mrclusters, get_all_hdfs, \
-                           get_cluster_conf_for_job_submission
-
-from desktop.conf import KERBEROS
-
-from django.utils.translation import ugettext as _
-
-LOG = logging.getLogger(__name__)
-SHELL_OUTPUT_LOGGER = logging.getLogger("shell_output")
-SHELL_INPUT_LOGGER = logging.getLogger("shell_input")
-
-_SETUID_PROG = os.path.join(os.path.dirname(__file__), 'build', 'setuid')
-
-class NewShellInterrupt(Exception):
-  """
-  Eventlet's greenlets only allow for exceptions as the way of communicating between greenlets.
-  We use the NewShellInterrupt for cross-greenlet communication.
-  """
-  def __init__(self, new_shell_pairs):
-    self.new_shell_pairs = new_shell_pairs
-
-class MergeToolException(Exception):
-  """
-  We need this exception to indicate that the delegation tokens merge tool failed.
-  """
-  pass
-
-class Shell(object):
-  """
-  A class to encapsulate I/O with a shell subprocess.
-  """
-  def __init__(self, shell_command, subprocess_env, shell_id, username, delegation_token_dir):
-    try:
-      user_info = pwd.getpwnam(username)
-    except KeyError:
-      LOG.error("Unix user account didn't exist at subprocess creation. Was it deleted?")
-      raise
-
-    parent, child = pty.openpty()
-
-    try:
-      tty.setraw(parent)
-    except tty.error:
-      LOG.debug("Could not set parent fd to raw mode, user will see duplicated input.")
-
-    subprocess_env[constants.HOME] = str(user_info.pw_dir)
-    command_to_use = [str(_SETUID_PROG), str(user_info.pw_uid), str(user_info.pw_gid)]
-    command_to_use.extend(shell_command)
-
-    delegation_token_files = self._get_delegation_tokens(username, delegation_token_dir)
-    if delegation_token_files:
-      merged_token_file_path = self._merge_delegation_tokens(delegation_token_files, delegation_token_dir)
-      for path in delegation_token_files:
-        try:
-          os.unlink(path)
-        except:
-          LOG.warning("Could not remove delegation token file %s" % path)
-      delegation_token_files = [merged_token_file_path]
-      subprocess_env[constants.HADOOP_TOKEN_FILE_LOCATION] = merged_token_file_path
-
-    try:
-      LOG.debug("Starting subprocess with command '%s' and environment '%s'" %
-                                                             (command_to_use, subprocess_env,))
-      p = subprocess.Popen(command_to_use, stdin=child, stdout=child, stderr=child,
-                                                                 env=subprocess_env, close_fds=True)
-    except (OSError, ValueError):
-      os.close(parent)
-      os.close(child)
-      raise
-
-    msg_format =  "%s - shell_id:%s pid:%d - args:%s"
-    msg_args = (username, shell_id, p.pid, ' '.join(command_to_use))
-    msg = msg_format % msg_args
-    SHELL_OUTPUT_LOGGER.info(msg)
-    SHELL_INPUT_LOGGER.info(msg)
-
-    # State that shouldn't be touched by any other classes.
-    self._output_buffer_length = 0
-    self._commands = []
-    self._fd = parent
-    self._child_fd = child
-    self.subprocess = p
-    self.pid = p.pid
-    self._write_buffer = cStringIO.StringIO()
-    self._read_buffer = cStringIO.StringIO()
-    self._delegation_token_files = delegation_token_files
-
-    # State that's accessed by other classes.
-    self.shell_id = shell_id
-    self.username = username
-    # Timestamp that is updated on shell creation and on every output request. Used so that we know
-    # when to kill the shell.
-    self.time_received = time.time()
-    self.last_output_sent = False
-    self.remove_at_next_iteration = False
-    self.destroyed = False
-
-  def _merge_delegation_tokens(self, delegation_token_files, delegation_token_dir):
-    """
-    Use the Credentials Merger utility to combine the delegation token files into one delegation token file.
-    Returns the NamedTemporaryFile that contains the combined delegation tokens.
-    """
-    merged_token_file_no, merged_token_file_path = tempfile.mkstemp(dir=delegation_token_dir)
-    os.close(merged_token_file_no)
-    merge_tool_args = [hadoop.conf.HDFS_CLUSTERS['default'].HADOOP_BIN.get(), 'jar']
-    merge_tool_args += [hadoop.conf.CREDENTIALS_MERGER_JAR.get(), merged_token_file_path]
-    merge_tool_args += delegation_token_files
-    LOG.debug("Merging credentials files with command: '%s'" % (' '.join(merge_tool_args)))
-    merge_process = subprocess.Popen(merge_tool_args, stderr=subprocess.PIPE, shell=False, close_fds=True)
-    while merge_process.poll() is None:
-      time.sleep(1)
-    retcode = merge_process.wait()
-    if retcode != 0:
-      LOG.error("Failed to merge credentials :'%s'..." % (merge_process.stderr.readline(),))
-      raise MergeToolException(_("bin/hadoop return non-zero %(retcode)d while trying to merge credentials.") % dict(retcode=(retcode,)))
-    return merged_token_file_path
-
-  def _get_delegation_tokens(self, username, delegation_token_dir):
-    """
-    If operating against Kerberized Hadoop, we'll need to have obtained delegation tokens for
-    the user we want to run the subprocess as. We have to do it here rather than in the subprocess
-    because the subprocess does not have Kerberos credentials in that case.
-    """
-    delegation_token_files = []
-    all_clusters = []
-    all_clusters += all_mrclusters().values()
-    all_clusters += get_all_hdfs().values()
-
-    LOG.debug("Clusters to potentially acquire tokens for: %s" % (repr(all_clusters),))
-
-    for cluster in all_clusters:
-      if cluster.security_enabled:
-        current_user = cluster.user
-        try:
-          cluster.setuser(username)
-          token = cluster.get_delegation_token(KERBEROS.HUE_PRINCIPAL.get())
-          token_file_no, path = tempfile.mkstemp(dir=delegation_token_dir)
-          os.write(token_file_no, token)
-          os.close(token_file_no)
-          delegation_token_files.append(path)
-        finally:
-          cluster.setuser(current_user)
-
-    return delegation_token_files
-
-  def mark_for_cleanup(self):
-    """
-    Flag this shell to be picked up at the next iteration of handle_periodic.
-    """
-    self.remove_at_next_iteration = True
-
-  def get_previous_output(self):
-    """
-    Called when a Hue session is restored. Returns a tuple of ( all previous output, next offset).
-    """
-    val = self._read_buffer.getvalue()
-    return ( val, len(val))
-
-  def get_previous_commands(self):
-    """
-    Return the list of previously entered commands. This is used for bash_history semantics
-    when restoring Shells.
-    """
-    return self._commands
-
-  def get_cached_output(self, offset):
-    """
-    The offset is not the latest one, so some output has already been generated and is
-    stored in the read buffer. So let's fetch it from there.
-    Returns (output, has_more, new_offset) or None.
-    """
-    self._read_buffer.seek(offset)
-    next_output = self._read_buffer.read()
-    if not next_output:
-      return None
-    more_available = len(next_output) >= shell.conf.SHELL_OS_READ_AMOUNT.get()
-    return (next_output, more_available, self._output_buffer_length)
-
-  def process_command(self, command):
-    """
-    Write the command to the end of the wite buffer, and spawn a greenlet to write it
-    into the subprocess when the subprocess becomes writable.
-
-    Returns a dictionary with {return_code: bool}.
-    """
-    # TODO(bc): Track the buffer size to avoid calling getvalue() every time
-    if len(self._write_buffer.getvalue()) >= shell.conf.SHELL_WRITE_BUFFER_LIMIT.get():
-      return { constants.BUFFER_EXCEEDED : True }
-    else:
-      self._append_to_write_buffer(command)
-      eventlet.spawn_n(self._write_child_when_able)
-      return { constants.SUCCESS : True }
-
-  def _append_to_write_buffer(self, command):
-    """
-    Append the received command to the write buffer. This buffer is used
-    when the child becomes readable to send commands to the child subprocess.
-    """
-    self._write_buffer.seek(len(self._write_buffer.getvalue()))
-    self._write_buffer.write("%s" % (command,))
-    # We seek back to the beginning so that when the child becomes writable we
-    # feed the commands to the child in the order they were received.
-    self._commands.append(command)
-    while len(self._commands) > 25:
-      self._commands.pop(0)
-
-  def _read_from_write_buffer(self):
-    """
-    Read and return the contents of the write buffer.
-    """
-    self._write_buffer.seek(0)
-    contents = self._write_buffer.read()
-    return contents
-
-  def _write_child_when_able(self):
-    """
-    Select on the child's input file descriptor becoming writable, and then write commands to it.
-    If not successful in writing all the commands, spawn a new greenlet to retry.
-    """
-    LOG.debug("write_child_when_able")
-    buffer_contents = self._read_from_write_buffer()
-    if not buffer_contents:
-      return
-
-    try:
-      r, w, x = select.select([],[self._fd],[])
-    except Exception, e:
-      # The next 9 lines are taken from Facebook's Tornado project, which is open-sourced under
-      # the Apache license.
-      # Depending on python version and poll implementation,
-      # different exception types may be thrown and there are
-      # two ways EINTR might be signaled:
-      # * e.errno == errno.EINTR
-      # * e.args is like (errno.EINTR, 'Interrupted system call')
-      if (getattr(e, 'errno') == errno.EINTR or
-          (isinstance(getattr(e, 'args'), tuple) and
-           len(e.args) == 2 and e.args[0] == errno.EINTR)):
-        LOG.warning("Interrupted system call", exc_info=1)
-        eventlet.spawn_n(self._write_child_when_able)
-      else:
-        LOG.error("Unexpected error on select")
-        self.mark_for_cleanup()
-      return
-
-    if not w:
-      return
-
-    try:
-      bytes_written = os.write(self._fd, buffer_contents)
-      self._advance_write_buffer(bytes_written)
-    except OSError, e:
-      if e.errno == errno.EINTR:
-        eventlet.spawn_n(self._write_child_when_able)
-      elif e.errno != errno.EAGAIN:
-        error_str = "%s - shell_id:%s pid:%d - Error writing to subprocess:%s" %\
-                                  (self.username, self.shell_id, self.pid, e,)
-        LOG.error(error_str)
-        SHELL_INPUT_LOGGER.error(error_str)
-        self.mark_for_cleanup()
-    else: # This else clause is on the try/except above, not the if/elif
-      if bytes_written != len(buffer_contents):
-        eventlet.spawn_n(self._write_child_when_able)
-
-  def _advance_write_buffer(self, num_bytes):
-    """
-    Advance the current position in the write buffer by num_bytes bytes.
-    """
-    # TODO: Replace this system with a list of cStringIO objects so that
-    # it's more efficient. We should do this if this seems to be copying
-    # a lot of memory around.
-    self._write_buffer.seek(num_bytes)
-    new_value = self._write_buffer.read()
-    self._write_buffer.truncate(0)
-    self._write_buffer.write(new_value)
-
-  def read_child_output(self):
-    """
-    Reads up to conf.SHELL_OS_READ_AMOUNT bytes from the child subprocess's stdout.
-    Returns a tuple of (output, more_available, new_offset).
-    The second parameter indicates whether more output might be obtained by
-    another call to read_child_output.
-    """
-    ofd = self._fd
-    result = None
-    try:
-      next_output = os.read(ofd, shell.conf.SHELL_OS_READ_AMOUNT.get())
-      self._read_buffer.seek(self._output_buffer_length)
-      self._read_buffer.write(next_output)
-      length = len(next_output)
-      self._output_buffer_length += length
-      num_excess_chars = self._output_buffer_length - shell.conf.SHELL_BUFFER_AMOUNT.get()
-      if num_excess_chars > 0:
-        self._read_buffer.seek(num_excess_chars)
-        newval = self._read_buffer.read()
-        self._read_buffer.truncate(0)
-        self._read_buffer.write(newval)
-        self._output_buffer_length = len(newval)
-    except OSError, e: # No more output at all
-      if e.errno == errno.EINTR:
-        pass
-      elif e.errno != errno.EAGAIN:
-        format_str = "Encountered error while reading from process with PID %d : %s"
-        LOG.error(format_str % (self.pid, e))
-        SHELL_OUTPUT_LOGGER.error(format_str % (self.pid, e))
-        self.mark_for_cleanup()
-    else:
-      more_available = length >= shell.conf.SHELL_OS_READ_AMOUNT.get()
-      result = (next_output, more_available, self._output_buffer_length)
-
-    return result
-
-  def destroy(self):
-    """
-    Clean up the resources used for this shell.
-    """
-    for delegation_token_file in self._delegation_token_files:
-      try:
-        os.unlink(delegation_token_file)
-      except:
-        LOG.warning("Could not remove delegation token file %s" % delegation_token_file)
-
-    try:
-      self._delegation_token_files = None
-      self._write_buffer.close()
-      self._read_buffer.close()
-
-      os.close(self._fd)
-      os.close(self._child_fd)
-
-      try:
-        LOG.debug("Sending SIGKILL to process with PID %d" % (self.pid,))
-        os.kill(self.pid, signal.SIGKILL)
-        _, exitcode = os.waitpid(self.pid, 0)
-        msg = "%s - shell_id:%s pid:%d - Exited with status %d" % (self.username, self.shell_id, self.pid, exitcode)
-      except OSError:
-        msg = "%s - shell_id:%s pid:%d - Killed successfully" % (self.username, self.shell_id, self.pid,)
-        # This means the subprocess was already killed, which happens if the command was "quit"
-        # This can also happen if the waitpid call results in an error, which we don't care about.
-      LOG.info(msg)
-      SHELL_OUTPUT_LOGGER.info(msg)
-      SHELL_INPUT_LOGGER.info(msg)
-    finally:
-      self.destroyed = True
-
-class ShellManager(object):
-  """
-  The class that manages state for all shell subprocesses.
-  """
-  def __init__(self):
-    self._shells = {} # Keys are (username, shell_id) tuples. Each user has his/her own set of shell ids.
-    self._command_by_short_name = {} # Map each short name to its command (e.g. ["pig", "-l", "/dev/null"])
-    self._meta = {} # Map usernames to utils.UserMetadata objects
-    self._greenlets_by_hid = {} # Map each Hue Instance ID (HID) to greenlet currently fetching output for that HID.
-    self._hids_by_pid = {} # Map each process ID (PID) to the HID whose greenlet is currently doing a "select" on the process's output fd.
-    self._greenlets_to_notify = {} # For each PID, maintain a set of greenlets who are also interested in the output from that process, but are not doing the select.
-    self._shells_by_fds = {} # Map each file descriptor to the Shell instance whose output it represents.
-    self._greenlet_interruptable = {} # For each greenlet, store if it can be safely interrupted.
-    self._env_by_short_name = {} # Map each short name to a dictionary which contains the environment for shells of that type.
-
-    self._delegation_token_dir = shell.conf.SHELL_DELEGATION_TOKEN_DIR.get()
-    if not os.path.exists(self._delegation_token_dir):
-      os.mkdir(self._delegation_token_dir)
-
-    self._parse_configs()
-    eventlet.spawn_after(1, self._handle_periodic)
-
-
-  @classmethod
-  def global_instance(cls):
-    if not hasattr(cls, "_global_instance"):
-      cls._global_instance = cls()
-    return cls._global_instance
-
-  def _parse_configs(self):
-    mr_cluster = get_cluster_conf_for_job_submission()
-    if mr_cluster is None:
-      mapred_home = None
-    else:
-      mapred_home = mr_cluster.HADOOP_MAPRED_HOME.get()
-
-    shell_types = [] # List of available shell types. For each shell type, we have a nice name (e.g. "Python Shell") and a short name (e.g. "python")
-    for item in shell.conf.SHELL_TYPES.keys():
-      if mapred_home:
-        env_for_shell = { constants.HADOOP_MAPRED_HOME: mapred_home }
-      else:
-        env_for_shell = {}
-      command = shell.conf.SHELL_TYPES[item].command.get().strip().split()
-      nice_name = shell.conf.SHELL_TYPES[item].nice_name.get().strip()
-      executable_exists = utils.executable_exists(command)
-      if executable_exists:
-        self._command_by_short_name[item] = command
-        conf_shell_env = shell.conf.SHELL_TYPES[item].environment
-        for env_variable in conf_shell_env.keys():
-          env_for_shell[env_variable] = conf_shell_env[env_variable].value.get()
-        self._env_by_short_name[item] = env_for_shell
-      shell_types.append({ constants.NICE_NAME: nice_name, constants.KEY_NAME: item, constants.EXISTS:executable_exists })
-    self.shell_types = shell_types
-
-  def available_shell_types(self, user):
-    username = user.username
-    try:
-      user_info = pwd.getpwnam(username)
-    except KeyError:
-      user_info = None
-    if not user_info:
-      return None
-
-    shell_types_for_user = []
-    for item in self.shell_types:
-      if user.has_hue_permission('launch_%s' % (item[constants.KEY_NAME],), 'shell'):
-        shell_types_for_user.append(item)
-    return shell_types_for_user
-
-  def _interrupt_conditionally(self, green_let, message):
-    """
-    If the greenlet is currently interruptable, (i.e. it's in a try/catch block with a handler
-    for a NewShellInterrupt, then interrupt it with the given message.
-    """
-    if self._greenlet_interruptable.get(green_let):
-      green_let.throw(message)
-
-  def _cleanup_greenlets_for_removed_pids(self, removed_pids):
-    """
-    Clean up any greenlets listening for the removed pids. This includes both selecting
-    greenlets and non-selecting greenlets.
-    """
-    greenlets_to_cleanup = set()
-    for pid in removed_pids:
-      listening_hid = self._hids_by_pid.get(pid)
-      if listening_hid:
-        greenlet_for_hid = self._greenlets_by_hid.get(listening_hid)
-        if greenlet_for_hid:
-          greenlets_to_cleanup.add(greenlet_for_hid)
-      non_selecting_greenlets = self._greenlets_to_notify.get(pid)
-      if non_selecting_greenlets:
-        greenlets_to_cleanup.update(non_selecting_greenlets)
-    nsi = NewShellInterrupt([])
-    for greenlet_to_notify in greenlets_to_cleanup:
-      eventlet.spawn_n(self._interrupt_conditionally, greenlet_to_notify, nsi)
-
-  def _handle_periodic(self):
-    """
-    Called every second. Kills shells which haven't been asked about in conf.SHELL_TIMEOUT
-    seconds (currently 600).
-    """
-    try:
-      keys_to_pop = []
-      current_time = time.time()
-      for key, shell_instance in self._shells.iteritems():
-        if shell_instance.last_output_sent or shell_instance.remove_at_next_iteration:
-          keys_to_pop.append(key)
-        else:
-          difftime = current_time - shell_instance.time_received
-          if difftime >= shell.conf.SHELL_TIMEOUT.get():
-            keys_to_pop.append(key)
-      removed_pids = [self._shells.get(key).pid for key in keys_to_pop]
-      for key in keys_to_pop:
-        self._cleanup_shell(key)
-    finally:
-      eventlet.spawn_n(self._cleanup_greenlets_for_removed_pids, removed_pids)
-      eventlet.spawn_after(1, self._handle_periodic)
-
-  def _cleanup_shell(self, key):
-    """
-    Clean up metadata for the shell specified by key.
-    """
-    shell_instance = self._shells[key]
-    shell_instance.destroy()
-    self._shells.pop(key)
-    username = key[0]
-    self._meta[username].decrement_count()
-    self._shells_by_fds.pop(shell_instance._fd)
-
-  def try_create(self, user, shell_name):
-    """
-    Attemps to create a new shell subprocess for the given user. Writes the appropriate failure or
-    success response to the client.
-    """
-    command = self._command_by_short_name.get(shell_name)
-    if not command:
-      return { constants.SHELL_CREATE_FAILED : True }
-
-    username = user.username
-    try:
-      user_info = pwd.getpwnam(username)
-    except KeyError:
-      return { constants.NO_SUCH_USER : True }
-
-    if not user.has_hue_permission('launch_%s' % (shell_name,), 'shell'):
-      return { constants.SHELL_NOT_ALLOWED : True }
-
-    if not username in self._meta:
-      self._meta[username] = utils.UserMetadata(username)
-
-    user_metadata = self._meta[username]
-    shell_id = user_metadata.get_next_id()
-    try:
-      msg = "%s - shell_id:%s - Creating %s shell with command '%s'" % (username, shell_id, shell_name, repr(command))
-      LOG.debug(msg)
-      # Let's make a copy of the subprocess's environment since the Shell constructor will modify
-      # the dictionary we pass in.
-      subprocess_env = self._env_by_short_name.get(shell_name, {}).copy()
-      shell_instance = Shell(command, subprocess_env, shell_id, username, self._delegation_token_dir)
-    except (OSError, ValueError, KeyError, MergeToolException):
-      LOG.exception("%s - shell_id:%s - Could not create %s shell" % (username, shell_id, shell_name))
-      return { constants.SHELL_CREATE_FAILED : True }
-
-    LOG.debug("%s - shell_id:%s pid:%d - Shell successfully created" % (username, shell_id, shell_instance.pid))
-    user_metadata.increment_count()
-    self._shells[(username, shell_id)] = shell_instance
-    self._shells_by_fds[shell_instance._fd] = shell_instance
-    return { constants.SUCCESS : True, constants.SHELL_ID : shell_id }
-
-  def kill_shell(self, username, shell_id):
-    """
-    Called when the user closes the Shell app instance in Hue. Kills the subprocess.
-    """
-    shell_instance = self._shells.get((username, shell_id))
-    if not shell_instance:
-      response = "%s - shell_id:%s - No such shell exists" % (username, shell_id)
-    else:
-      shell_instance.mark_for_cleanup()
-      response = "%s - shell_id:%s - Shell successfully marked for cleanup" % (username, shell_id)
-    LOG.debug(response)
-    return response
-
-  def get_previous_output(self, username, shell_id):
-    """
-    Called when the Hue session is restored. Get the outputs that we have previously written out to
-    the client as one big string.
-    """
-    shell_instance = self._shells.get((username, shell_id))
-    if not shell_instance:
-      return { constants.SHELL_KILLED : True }
-    shell_instance.time_received = time.time()
-    output, next_offset = shell_instance.get_previous_output()
-    commands = shell_instance.get_previous_commands()
-    return { constants.SUCCESS: True, constants.OUTPUT: output, constants.NEXT_OFFSET: next_offset,
-      constants.COMMANDS: commands}
-
-  def process_command(self, username, shell_id, command):
-    """
-    Find the shell specified by the (username, shell_id) tuple, and then write the incoming command
-    to that shell.
-    """
-    shell_instance = self._shells.get((username, shell_id))
-    if not shell_instance:
-      return { constants.NO_SHELL_EXISTS : True }
-    shell_instance.time_received = time.time()
-    command += "\n"
-    return shell_instance.process_command(command)
-
-  def _interrupt_with_output(self, readable):
-    """
-    For each of the readable file descriptors, find all greenlets which were not themselves
-    selecting but were interested in the output, and spawn a greenlet to go wake each
-    of them up.
-    """
-    greenlets_set = set()
-    for fd in readable:
-      shell_instance = self._shells_by_fds.get(fd)
-      if not shell_instance:
-        LOG.error("Shell for readable file descriptor '%d' is missing" % (fd,))
-      else:
-        greenlets_to_notify = self._greenlets_to_notify.get(shell_instance.pid, [])
-        greenlets_set.update(greenlets_to_notify)
-    nsi = NewShellInterrupt([])
-    for greenlet_to_notify in greenlets_set:
-      eventlet.spawn_n(self._interrupt_conditionally, greenlet_to_notify, nsi)
-
-  def _read_helper(self, shell_instance, offset=None):
-    if offset is not None:
-      read_result = shell_instance.get_cached_output(offset)
-    else:
-      read_result = shell_instance.read_child_output()
-    if not read_result:
-      return None
-    total_output, more_available, next_offset = read_result
-    # If this is the last output from the shell, let's tell the JavaScript that.
-    if shell_instance.subprocess.poll() is None:
-      status = constants.ALIVE
-    else:
-      status = constants.EXITED
-      shell_instance.last_output_sent = True
-    return { status : True,
-            constants.OUTPUT : total_output,
-            constants.MORE_OUTPUT_AVAILABLE : more_available,
-            constants.NEXT_OFFSET : next_offset }
-
-  def retrieve_output(self, username, hue_instance_id, shell_pairs):
-    """
-    Called when an output request is received from the client. Sends the request to the appropriate
-    shell instances.
-    """
-    time_received = time.time()
-    current_greenlet = eventlet.getcurrent()
-    self._greenlets_by_hid[hue_instance_id] = current_greenlet
-    shell_pairs = set(shell_pairs)
-
-    # Update the time stamps on all shells
-    self._update_access_time(username,
-                             time_received,
-                             [ p[0] for p in shell_pairs ])
-
-    result = None
-    # The main long-polling loop
-    while (time.time() - time_received) < constants.BROWSER_REQUEST_TIMEOUT:
-      # If we have cached output, find that and return immediately
-      cached_output = self._retrieve_cached_output(username, shell_pairs)
-      if len(cached_output) != 0:
-        return cached_output
-
-      fds_to_listen_for = []
-      shell_instances_for_listened_fds = {}
-
-      #
-      # Figure out which shell we should select on.
-      #
-      # Note that only one greenlet (request handler) may select on a given
-      # shell. So we build a registration mechanism with _hids_by_pid.
-      # If somebody else is already doing a select, then we add ourselves to
-      # _greenlets_to_notify.
-      #
-      # Each hid is generated by the frontend uniquely. It safely maps to a
-      # unique greenlet.
-      #
-      for shell_id, _ in shell_pairs:
-        shell_instance = self._shells.get((username, shell_id))
-        # Here we can assume shell_instance exists because if it didn't, we would have broken out of
-        # the while loop above and we wouldn't be executing this code.
-        listening_hid = self._hids_by_pid.get(shell_instance.pid)
-        if listening_hid is not None and listening_hid != hue_instance_id:
-          self._greenlets_to_notify.setdefault(shell_instance.pid, set()).add(current_greenlet)
-        else:
-          fds_to_listen_for.append(shell_instance._fd)
-          shell_instances_for_listened_fds[shell_instance._fd] = shell_instance
-          self._hids_by_pid[shell_instance.pid] = hue_instance_id
-
-      try:
-        time_remaining = constants.BROWSER_REQUEST_TIMEOUT - (time.time() - time_received)
-        self._greenlet_interruptable[current_greenlet] = True
-        readable, writable, exception_occurred = select.select(fds_to_listen_for, [], [], time_remaining)
-        self._greenlet_interruptable[current_greenlet] = False
-      except NewShellInterrupt, nsi:
-        self._greenlet_interruptable[current_greenlet] = False
-        # Here, I'm assuming that we won't have a situation where one of the (shell_id, offset)
-        # tuples in nsi.new_shell_pairs has the same shell_id as an item in shell_pairs, but
-        # an offset with a different (has to be higher) number.
-        shell_pairs.update(nsi.new_shell_pairs)
-      else:
-        if not readable:
-          result = { constants.PERIODIC_RESPONSE: True }
-        else:
-          result = {}
-          for fd in readable:
-            shell_instance = shell_instances_for_listened_fds[fd]
-            if shell_instance.destroyed:
-              result[shell_instance.shell_id] = { constants.SHELL_KILLED : True }
-            else:
-              result[shell_instance.shell_id] = self._read_helper(shell_instance)
-          eventlet.spawn_n(self._interrupt_with_output, readable)
-          break
-
-    if not result:
-      result = { constants.PERIODIC_RESPONSE: True }
-
-    self._greenlets_by_hid.pop(hue_instance_id)
-    for shell_id, _ in shell_pairs:
-      shell_instance = self._shells.get((username, shell_id))
-      if shell_instance:
-        if self._hids_by_pid.get(shell_instance.pid) == hue_instance_id:
-          self._hids_by_pid.pop(shell_instance.pid)
-        else:
-          try:
-            self._greenlets_to_notify[shell_instance.pid].remove(current_greenlet)
-          except KeyError:
-            LOG.error("Greenlet for pid %d was not found in set of listening greenlets" % (shell_instance.pid,))
-    return result
-
-  def add_to_output(self, username, hue_instance_id, shell_pairs):
-    """
-    Adds the given shell_id, offset pairs to the output connection associated with the given Hue
-    instance ID.
-    """
-    new_shells_interrupt = NewShellInterrupt(shell_pairs)
-    greenlet_for_hid = self._greenlets_by_hid.get(hue_instance_id)
-    if greenlet_for_hid:
-      eventlet.spawn_n(self._interrupt_conditionally, greenlet_for_hid, new_shells_interrupt)
-    return { constants.SUCCESS : True }
-
-  def _update_access_time(self, username, atime, shell_id_list):
-    """Update the time_received field in all specified shells"""
-    for shell_id in shell_id_list:
-      shell_instance = self._shells.get((username, shell_id))
-      if shell_instance:
-        shell_instance.time_received = atime
-
-  def _retrieve_cached_output(self, username, shell_pairs):
-    """
-    Try to get cached output from the shells.
-    Returns a dictionary of { shell_id: output_json }
-    """
-    result = { }
-    for shell_id, offset in shell_pairs:
-      shell_instance = self._shells.get((username, shell_id))
-      if shell_instance:
-        cached_output = self._read_helper(shell_instance, offset)
-        if cached_output:
-          result[shell_id] = cached_output
-      else:
-        LOG.warn("%s - shell_id:%s - No such shell exists" % (username, shell_id))
-        result[shell_id] = { constants.NO_SHELL_EXISTS: True }
-
-    return result

BIN
apps/shell/src/shell/static/art/icon_shell_24.png


BIN
apps/shell/src/shell/static/art/shell.png


BIN
apps/shell/src/shell/static/help/images/23888153.png


+ 0 - 151
apps/shell/src/shell/static/help/index.html

@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html
-  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<link rel="stylesheet" type="text/css" href="commonltr.css"/>
-<title>Hue Shell</title>
-</head>
-<body id="topic_10"><a name="topic_10"><!-- --></a>
-
-
-
-  <h1 class="title topictitle1">Hue Shell</h1>
-
-
-  <div class="body conbody">
-
-    <p class="p">
-      The Hue Shell application provides access to the Pig, HBase, and Sqoop 2 command-line shells. The Shell
-      application is designed to have the same look and feel as a Unix terminal. In addition to the shells configured by
-      default, it is possible to include almost any process that exposes a command-line interface as an option in this
-      Hue application.
-    </p>
-
-
-  </div>
-
-
-  <div class="topic concept nested1" xml:lang="en-US" lang="en-US" id="topic_10_1"><a name="topic_10_1"><!-- --></a>
-
-    <h2 class="title topictitle2">Hue Shell Installation and Configuration</h2>
-
-    <div class="body conbody">
-
-      <p class="p"> Hue Shell is one of the applications installed as part of Hue. <span class="ph">For information about installing and configuring Hue,
-        see Hue Installation in <a class="xref" href="http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH4/latest/CDH4-Installation-Guide/CDH4-Installation-Guide.html" target="_blank">http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH4/latest/CDH4-Installation-Guide/CDH4-Installation-Guide.html</a>.</span></p>
-
-
-    </div>
-
-
-    <div class="topic concept nested2" xml:lang="en-US" lang="en-US" id="topic_10_1_1"><a name="topic_10_1_1"><!-- --></a>
-
-      <h3 class="title topictitle3">  Unix User Accounts
-     </h3>
-
-
-      <div class="body conbody">
-
-        <p class="p"> To properly isolate subprocesses so as to guarantee security, each
-          Hue user who is using the Shell subprocess must have a Unix user account. The link between
-          Hue users and Unix user accounts is the username, and so every Hue user who wants to use
-          the Shell application must have a Unix user account with the same name on the system that
-          runs the Hue Server. See Unix User Accounts in <a class="xref" href="http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH4/latest/CDH4-Installation-Guide/CDH4-Installation-Guide.html" target="_blank">http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH4/latest/CDH4-Installation-Guide/CDH4-Installation-Guide.html</a> for instructions. </p>
-
-
-      </div>
-
-
-    </div>
-
-
-  </div>
-
-
-  <div class="topic concept nested1" xml:lang="en-US" lang="en-US" id="topic_10_2"><a name="topic_10_2"><!-- --></a>
-
-    <h2 class="title topictitle2">Starting Hue Shell</h2>
-
-    <div class="body conbody">
-
-      <ol class="ol">
-
-        <li class="li">Click the <strong class="ph b">Shell</strong> icon (<img class="image" src="/static/art/help/icon_shell_24.png"/>)
-          in the navigation bar at the top of the Hue web page. (To start a second instance of the
-          Shell application, right-click the link and select <strong class="ph b">Open link
-            in new tab</strong>.) The <strong class="ph b">Shell</strong> window opens in the Hue web
-          page.</li>
-
-
-        <li class="li">Click any of the tabs at the top of the Shell window to open a
-          subprocess shell of that type. <div class="note note"><span class="notetitle"><img src="/static/art/help/note.jpg"/> 
-      <b>Note</b>:</span> If a button is disabled, the program is not on the
-            system path. Ask your Hue administrator to fix this problem.</div>
-
-        </li>
-
-
-        <li class="li">After opening a subprocess, click anywhere in the body of the Shell application
-					window to focus the command line. (Tab-completion is not supported.)</li>
-
-
-        <li class="li">To end a process, type <samp class="ph codeph">exit</samp> or <samp class="ph codeph">quit</samp> depending
-					on the type of subprocess you have opened.
-
-                <div class="note note"><span class="notetitle"><img src="/static/art/help/note.jpg"/> 
-      <b>Note</b>:</span> 
-                  If you close your browser, the underlying shell process remains running for the amount of
-                  time specified by your Hue administrator. After this time the process is killed.
-                </div>
-
-        </li>
-
-
-      </ol>
-
-
-    </div>
-
-
-  </div>
-
-
-  <div class="topic concept nested1" xml:lang="en-US" lang="en-US" id="topic_10_3"><a name="topic_10_3"><!-- --></a>
-
-    <h2 class="title topictitle2">Viewing Documentation for the Shells</h2>
-
-    <div class="body conbody">
-
-      <p class="p">
-        For information about using each of the default shells, see the documentation on the following sites:
-      </p>
-
-
-      <ul class="ul">
-
-        <li class="li"><a class="xref" href="http://archive.cloudera.com/cdh4/cdh/4/pig/" target="_blank">Pig</a>
-        </li>
-
-
-        <li class="li"><a class="xref" href="http://archive.cloudera.com/cdh4/cdh/4/hbase/" target="_blank">HBase</a>
-        </li>
-
-
-        <li class="li"><a class="xref" href="http://archive.cloudera.com/cdh4/cdh/4/sqoop2/" target="_blank">Sqoop 2</a>
-        </li>
-
-
-      </ul>
-
-
-    </div>
-
-
-  </div>
-
-
-
-</body>
-</html>

+ 0 - 34
apps/shell/src/shell/templates/failed_to_create.mako

@@ -1,34 +0,0 @@
-## Licensed to Cloudera, Inc. under one
-## or more contributor license agreements.  See the NOTICE file
-## distributed with this work for additional information
-## regarding copyright ownership.  Cloudera, Inc. 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.
-<%!
-from desktop.views import commonheader, commonfooter
-from django.utils.translation import ugettext as _
-%>
-
-${ commonheader(_("Error"), "shell", user) | n,unicode }
-<div class="container-fluid">
-<div>
-    <h3>${_('Failed to create a shell of the given type. The possible reasons for this are:')}</h3>
-    <ol>
-        <li>${_('The system is out of PTYs.')}</li>
-        <li>${_('The system cannot create more subprocesses.')}</li>
-        <li>${_('You do not have permission to create shells of this type.')}</li>
-        <li>${_('There is no shell with that name.')}</li>
-        <li>${_('There is no Unix user account for you.')}</li>
-    </ol>
-</div>
-</div>
-${ commonfooter(messages) | n,unicode }

+ 0 - 319
apps/shell/src/shell/templates/index.mako

@@ -1,319 +0,0 @@
-## Licensed to Cloudera, Inc. under one
-## or more contributor license agreements.  See the NOTICE file
-## distributed with this work for additional information
-## regarding copyright ownership.  Cloudera, Inc. 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.
-<%!
-from desktop.views import commonheader, commonfooter
-from django.utils.translation import ugettext as _
-%>
-
-
-${ commonheader(None, "shell", user, "100px") | n,unicode }
-
-<div class="subnav subnav-fixed">
-    <div class="container-fluid">
-        <ul class="nav nav-pills">
-            % for shell in shells:
-                % if shell["exists"]:
-                    <li><a href="${url('shell.views.create')}?keyName=${shell["keyName"]}" class="${shell["keyName"]}">${shell["niceName"]}</a></li>
-                % else:
-                    <li class="disabled"><a>${shell["niceName"]}</a></li>
-                % endif
-            % endfor
-        </ul>
-    </div>
-</div>
-
-
-<div class="container-fluid">
-  % if shell_id:
-    <style type="text/css" media="screen">
-      body {
-        background-color: #333;
-      }
-
-      .shell {
-        background-color: #333;
-        color: #EEE;
-        font-family: monospace;
-        font-size: 14px;
-      }
-
-      #shellOutput {
-        padding: 0;
-        width: 100%;
-      }
-
-      #shellInput {
-        border: none;
-        outline: none;
-        margin: 0;
-        margin-top: 0px;
-        margin-bottom: 10px;
-        padding: 0;
-        padding-top: 8px;
-        box-shadow: none;
-        width: 400px;
-        background-color: #333333;
-        color: #EEE;
-      }
-
-      #shellInput:focus {
-        box-shadow: none;
-        border: none;
-      }
-    </style>
-    <div id="shellOutput" class="shell">
-        <span id="shellContent"></span>
-        <input type="text" id="shellInput" class="shell" />
-    </div>
-    <span id="shell_id" class="hide">${shell_id}</span>
-  % else:
-    <div>
-        <h3>
-            % if shells:
-                ${_('Select one of the available shells from the toolbar above.')}
-            % else:
-                ${_('You do not have permission to access any shell or there is no configured shell.')}
-            % endif
-        </h3>
-    </div>
-  % endif
-
-<script type="text/javascript" charset="utf-8">
-    $(document).ready(function(){
-      $(".disabled").tooltip({
-        title: '${_("The shell is not present on the Hue host.")}',
-        placement: 'bottom'
-      });
-
-      var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
-      for (var i = 0; i < hashes.length; i++) {
-        if (hashes[i].indexOf("keyName") > -1) {
-          $("." + hashes[i].split("=")[1]).addClass("selected");
-        }
-      }
-
-      var hueInstanceID = function () {
-        var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
-        var lastIndex = chars.length - 1;
-        var stringLength = 128;
-        var randomString = "";
-        for (var i = 0; i < stringLength; i++) {
-          var randomIndex = Math.floor(Math.random() * lastIndex);
-          randomString += chars.substring(randomIndex, randomIndex + 1);
-        }
-        return randomString;
-      }();
-
-      var history = (function () {
-        var previousCommands = [];
-        var currentCommandIndex = 0;
-        var temporaryCommand = "";
-
-        return {
-          recordCommand: function (command) {
-            if (command) {
-              previousCommands.push(command);
-              currentCommandIndex = previousCommands.length;
-              temporaryCommand = "";
-            }
-          },
-          getPreviousCommand: function () {
-            var command = "";
-            if (currentCommandIndex > 0) {
-              currentCommandIndex--;
-              command = previousCommands[currentCommandIndex];
-            }
-            else {
-              if (previousCommands.length > 0) {
-                command = previousCommands[0];
-              }
-            }
-            return command;
-          },
-          getNextCommand: function () {
-            var command = "";
-            if (currentCommandIndex < previousCommands.length - 1) {
-              currentCommandIndex++;
-              command = previousCommands[currentCommandIndex];
-            }
-            else {
-              currentCommandIndex = previousCommands.length;
-              command = temporaryCommand;
-            }
-            return command;
-          },
-          updateTemporaryCommand: function (partial) {
-            temporaryCommand = partial;
-          }
-        };
-      })();
-
-      function setShellInput(command) {
-        if (command != null) {
-          $("#shellInput").val(command);
-        }
-      };
-
-      if ($("#shell_id").length) {
-        var shell = {};
-        shell.id = $("#shell_id").text();
-        shell.get = function (offset) {
-          var _shell = this;
-          $.ajax({
-            type: "POST",
-            url: "/shell/retrieve_output",
-            data: {
-              numPairs: 1,
-              offset1: offset,
-              shellId1: _shell.id
-            },
-            beforeSend: function (xhr) {
-              xhr.setRequestHeader("X-Request", "JSON");
-              xhr.setRequestHeader("Hue-Instance-ID", hueInstanceID);
-            },
-            success: function (data, status, xhr) {
-              if (status == "success") {
-                if (data.periodicResponse) {
-                  shell.get(offset);
-                }
-                else {
-                  var output = data[_shell.id].output;
-                  output = output.replace(/&/g, '&amp;')
-                          .replace(/</g, '&lt;')
-                          .replace(/>/g, '&gt;')
-                          .replace(/"/g, '&quot;')
-                          .replace(/\n/g, '<br/>');
-                  $("#shellContent").append(output);
-                  if (output.indexOf("Disconnected!") > -1) {
-                    window.setTimeout(function () {
-                      $.ajax({
-                        type: "POST",
-                        url: "/shell/kill_shell",
-                        data: {
-                          shellId: _shell.id
-                        },
-                        beforeSend: function (xhr) {
-                          xhr.setRequestHeader("X-Request", "JSON");
-                        },
-                        success: function (data, status, xhr) {
-                          location.href = "/shell/";
-                        }
-                      });
-                    }, 500);
-                  }
-                  resizeShellInput();
-                  focusShellInput();
-                  $("html, body").animate({ scrollTop: $(document).height() }, "fast");
-                  _shell.get(data[_shell.id].nextOffset);
-                }
-              }
-            }
-          });
-        };
-        shell.send = function (command) {
-          var _shell = this;
-          $.ajax({
-            type: "POST",
-            url: "/shell/process_command",
-            data: {
-              lineToSend: command,
-              shellId: _shell.id
-            },
-            beforeSend: function (xhr) {
-              xhr.setRequestHeader("X-Request", "JSON");
-            },
-            success: function (data, status, xhr) {
-              if (status == "success") {
-                if (command == "quit") {
-                  window.setTimeout(function () {
-                    $.ajax({
-                      type: "POST",
-                      url: "/shell/kill_shell",
-                      data: {
-                        shellId: _shell.id
-                      },
-                      beforeSend: function (xhr) {
-                        xhr.setRequestHeader("X-Request", "JSON");
-                      },
-                      success: function (data, status, xhr) {
-                        location.href = "/shell/";
-                      }
-                    });
-                  }, 500);
-                }
-              }
-            }
-          });
-        };
-
-        shell.get(0);
-
-        $("#shellInput").val("");
-
-        $("#shellInput").focus();
-
-        $("#shellInput").keydown(function (e) {
-          var input = null;
-          var key = e.keyCode ? e.keyCode : e.which
-          if (key == 13) {
-            shell.send($(this).val());
-            history.recordCommand($(this).val());
-            input = ""
-          } else if (key == 38) {
-            input = history.getPreviousCommand();
-            e.preventDefault();
-          } else if (key == 40) {
-            input = history.getNextCommand();
-            e.preventDefault();
-          }
-          setShellInput(input);
-        });
-
-        $("#shellInput").keyup(function (e) {
-          var key = e.keyCode ? e.keyCode : e.which
-          if ((key > 46 && key < 91) || (key > 95 && key < 112) || (key > 185)) {
-            history.updateTemporaryCommand($(this).val());
-          }
-        });
-
-        $(document).keypress(function (e) {
-          focusShellInput();
-        });
-      }
-
-      function focusShellInput() {
-        if (!$("#shellInput").is(":focus")) {
-          $("#shellInput").focus();
-        }
-      }
-
-      var _resizeTimeout = -1;
-      $(window).on("resize", function () {
-        window.clearTimeout(_resizeTimeout);
-        _resizeTimeout = window.setTimeout(function () {
-          resizeShellInput();
-        }, 300);
-      })
-
-      function resizeShellInput() {
-        $("#shellInput").width(20); // force resize to get position of the input
-        $("#shellInput").width($(document).width() - $("#shellInput").position().left - 40)
-      }
-    });
-</script>
-</div>
-
-${ commonfooter(messages) | n,unicode }

+ 0 - 30
apps/shell/src/shell/templates/no_such_user.mako

@@ -1,30 +0,0 @@
-## Licensed to Cloudera, Inc. under one
-## or more contributor license agreements.  See the NOTICE file
-## distributed with this work for additional information
-## regarding copyright ownership.  Cloudera, Inc. 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.
-<%!
-from desktop.views import commonheader, commonfooter
-from django.utils.translation import ugettext as _
-%>
-
-${ commonheader(_("Error"), "shell", user) | n,unicode }
-<div class="container-fluid">
-<div>
-    <h3>${_('The Shell application requires a Unix user account for every user of Hue on the remote web server.')}</h3>
-    <br/>
-    ${_('Ask your administrator to create a user account for you on the remote web server as described in the Shell documentation.')}
-
-</div>
-</div>
-${ commonfooter(messages) | n,unicode }

+ 0 - 27
apps/shell/src/shell/templates/not_running_spawning.mako

@@ -1,27 +0,0 @@
-## Licensed to Cloudera, Inc. under one
-## or more contributor license agreements.  See the NOTICE file
-## distributed with this work for additional information
-## regarding copyright ownership.  Cloudera, Inc. 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.
-<%!
-from desktop.views import commonheader, commonfooter
-from django.utils.translation import ugettext as _
-%>
-
-${ commonheader(_('Error'), "shell", user) | n,unicode }
-<div class="container-fluid">
-<div>
-	<h3>${_('The webserver currently running Hue does not support the Shell application. Please contact your administrator.')}</h3>
-</div>
-</div>
-${ commonfooter(messages) | n,unicode }

+ 0 - 149
apps/shell/src/shell/tests.py

@@ -1,149 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. 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.
-
-"""
-Tests for "shell"
-"""
-
-from nose.tools import assert_true, assert_equal
-
-from desktop.lib.django_test_util import make_logged_in_client
-from django.contrib.auth.models import User
-import eventlet.wsgi
-from eventlet.green import time
-from eventlet.green import os
-from eventlet.green import threading
-import pwd
-import re
-import shell
-import shell.constants as constants
-import shell.utils as utils
-from shell.views import remove_colors
-
-class TestServer(threading.Thread):
-  def run(self):
-    def dummy_server(env, start_response):
-      start_response('200 OK', [('Content-Type', 'text/plain')])
-      return ['Dummy response\r\n']
-    eventlet.wsgi.server(eventlet.listen(('',55555)), dummy_server)
-
-class TestRequest(object):
-  def __init__(self):
-    self.POST = {}
-    self.DICT = {}
-    self.META = {}
-
-def reset_all_users():
-  """Reset to a clean state by deleting all users"""
-  for user in User.objects.all():
-    user.delete()
-
-def test_spawning_check():
-  reset_all_users()
-  client = make_logged_in_client(username="test", is_superuser=True)
-
-  get_urls = ["/shell/", "/shell/create"]
-  post_urls = ["/shell/create", "/shell/process_command", "/shell/kill_shell",
-               "/shell/retrieve_output", "/shell/add_to_output"]
-  for url in get_urls:
-    response = client.get(url, follow=True)
-    assert "The webserver currently running Hue does not support the Shell" in response.content
-
-  for url in post_urls:
-    response = client.post(url, follow=True)
-    assert "notRunningSpawning" in response.content
-
-def test_unix_user_account_check():
-  reset_all_users()
-  nonexistent_username = "user_%s" % (time.strftime("%s"),)
-  client = make_logged_in_client(username=nonexistent_username, is_superuser=True)
-
-  d = { 'eventlet.input' : None }
-  response = client.get('/shell/', follow=True, **d)
-  assert "The Shell application requires a Unix user account for every user of Hue" in response.content
-
-def test_rest():
-  reset_all_users()
-  username = pwd.getpwuid(os.getuid()).pw_name
-  client = make_logged_in_client(username=username, is_superuser=True)
-
-  d = { 'eventlet.input' : None }
-  response = client.get('/shell/', follow=True, **d)
-
-  shell_types_available = []
-  for item in shell.conf.SHELL_TYPES.keys():
-    nice_name = shell.conf.SHELL_TYPES[item].nice_name.get().strip()
-    assert nice_name in response.content
-    command = shell.conf.SHELL_TYPES[item].command.get().strip().split()
-    if utils.executable_exists(command):
-      shell_types_available.append(item)
-
-  if not shell_types_available:
-    return
-
-  response = client.get('/shell/create?keyName=%s' % (time.strftime("%s"),), follow=True, **d)
-  assert "There is no shell with that name." in response.content
-
-  nonexistent_username = "user_%s" % (time.strftime("%s"),)
-  client2 = make_logged_in_client(username=nonexistent_username, is_superuser=True)
-
-  response = client2.get("/shell/create?keyName=%s" % (shell_types_available[0],), follow=True, **d)
-  assert "There is no Unix user account for you." in response.content
-
-  response = client.get("/shell/create?keyName=%s" % (shell_types_available[0],), follow=True, **d)
-  fragment = '<span id="shell_id" class="hide">'
-  assert fragment in response.content
-
-  shell_id_start = response.content.index(fragment) + len(fragment)
-  shell_id_end = response.content.index('</span>', shell_id_start)
-  shell_id = response.content[shell_id_start:shell_id_end]
-  assert re.match(r"^\s*\d+\s*$", shell_id)
-
-  response = client.post("/shell/kill_shell", follow=True, data={constants.SHELL_ID: shell_id}, **d)
-  assert 'Shell successfully marked for cleanup' in response.content
-
-def test_parse_shell_pairs():
-  request = TestRequest()
-  request.POST[constants.NUM_PAIRS] = 2
-  request.POST["%s2" % (constants.SHELL_ID,)] = '0'
-  request.POST["%s2" % (constants.OFFSET,)] = '0'
-  request.POST["%s1" % (constants.SHELL_ID,)] = '1'
-  request.POST["%s1" % (constants.OFFSET,)] = '1'
-  parsed_pairs = utils.parse_shell_pairs(request)
-  assert parsed_pairs[0][0] == '1'
-  assert parsed_pairs[0][1] == 1
-  assert parsed_pairs[1][0] == '0'
-  assert parsed_pairs[1][1] == 0
-
-  request.POST[constants.NUM_PAIRS] = 1
-  assert len(utils.parse_shell_pairs(request)) == 1
-
-  request.POST[constants.NUM_PAIRS] =  'most definitely not a number'
-  try:
-    utils.parse_shell_pairs(request)
-  except ValueError:
-    pass
-  else:
-    assert False, "parse_shell_pairs did not throw an exception when trying to convert a malformed string to integer"
-
-def test_remove_colors():
-  text = '\x1b[0m\x1b[01;34mlogs\x1b[0m\nLICENSE.txt' # Bash
-  assert_equal('logs\nLICENSE.txt', remove_colors(text))
-
-  text = "\x1b[32mSqoop Shell:\x1b[m Type '\x1b[1mhelp\x1b[m' or '\x1b[1m\\h\x1b[m' for help.\n\n" # Sqoop2
-  assert_equal("Sqoop Shell: Type 'help' or '\\h' for help.\n\n", remove_colors(text))

+ 0 - 27
apps/shell/src/shell/urls.py

@@ -1,27 +0,0 @@
-#!/usr/bin/env python
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. 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.
-
-from django.conf.urls.defaults import patterns, url
-
-urlpatterns = patterns('shell',
-  url(r'^$', 'views.index'),
-  url(r'^process_command/?$', 'views.process_command'),
-  url(r'^kill_shell/?$', 'views.kill_shell'),
-  url(r'^create/?$', 'views.create'),
-  url(r'^retrieve_output/?$', 'views.retrieve_output'),
-  url(r'^add_to_output/?$', 'views.add_to_output'),
-)

+ 0 - 99
apps/shell/src/shell/utils.py

@@ -1,99 +0,0 @@
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. 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.
-
-"""
-A mixed bag of utilities that are useful for the Shell app but aren't terribly interesting.
-"""
-
-import desktop.lib.i18n
-import logging
-import shell.constants as constants
-from eventlet.green import os
-
-LOG = logging.getLogger(__name__)
-
-def parse_shell_pairs(request):
-  """
-  Parses out and returns a list of (shell_id, offset) tuples from a descendant of RequestHandler.
-  """
-  shell_pairs = []
-  num_pairs = int(request.POST.get(constants.NUM_PAIRS, ""))
-
-  for i in xrange(1, num_pairs+1):
-    try:
-      shell_id_i = request.POST.get("%s%d" % (constants.SHELL_ID, i), "-1")
-      offset_i = int(request.POST.get("%s%d" % (constants.OFFSET, i), "-1"))
-    except ValueError:
-      LOG.debug('Bad HTTP parameter : "%s%d" has value "%s"' % (constants.OFFSET, i,
-                                      request.POST.get("%s%d" % (constants.SHELL_ID, i), "-1")))
-    else:
-      shell_pairs.append((shell_id_i, offset_i, ))
-  return shell_pairs
-
-
-def executable_exists(executable):
-  if not executable:
-    return False
-  if type(executable) == list:
-    executable = executable[0]
-  env = desktop.lib.i18n.make_utf8_env()
-  path = env.get("PATH", os.defpath)
-  path = [os.path.normpath(item) for item in path.strip().strip(os.pathsep).split(os.pathsep)]
-  for item in path:
-    potential_executable = os.path.join(item, executable)
-    if os.access(potential_executable, os.F_OK | os.X_OK):
-      return True
-  return False
-
-
-class UserMetadata(object):
-  """
-  A simple class to encapsulate the metadata for a user.
-  """
-  def __init__(self, username):
-    self.num_shells = 0
-    self.current_shell_id = 0
-    self.username = username
-
-  def get_next_id(self):
-    """
-    Return the next available ID. Successive calls to this function will yield two different IDs.
-    Returns a unicode string for compatibility with Tornado.
-    """
-    curr_id = self.current_shell_id
-    self.current_shell_id += 1
-    return unicode(curr_id)
-
-  def decrement_count(self):
-    """
-    Decrement the number of shells currently open for the given user.
-    """
-    if self.num_shells > 0:
-      self.num_shells -= 1
-    else:
-      LOG.error("Num shells is negative for user %s" % (self.username,))
-
-  def increment_count(self):
-    """
-    Increment the number of shells currently open for the given user.
-    """
-    self.num_shells += 1
-
-  def get_shell_count(self):
-    """
-    Return the number of shells currently open for the given user.
-    """
-    return self.num_shells

+ 0 - 138
apps/shell/src/shell/views.py

@@ -1,138 +0,0 @@
-#!/usr/bin/env python
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. 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.
-
-import re
-
-from desktop.lib.django_util import render
-from django.http import HttpResponse
-import logging
-import simplejson
-import shell.constants as constants
-import shell.utils as utils
-from shell.shellmanager import ShellManager
-
-
-SHELL_OUTPUT_LOGGER = logging.getLogger("shell_output")
-SHELL_INPUT_LOGGER = logging.getLogger("shell_input")
-
-def _running_with_spawning(request):
-  return 'eventlet.input' in request.META
-
-def index(request):
-  if not _running_with_spawning(request):
-    return render('not_running_spawning.mako', request, {})
-  shell_manager = ShellManager.global_instance()
-  result = shell_manager.available_shell_types(request.user)
-  if result is None:
-    return render('no_such_user.mako', request, {})
-  return render('index.mako', request, {'shells':result})
-
-def create(request):
-  if not _running_with_spawning(request):
-    if request.method == "POST":
-      result = simplejson.dumps({ constants.NOT_RUNNING_SPAWNING : True })
-      return HttpResponse(result, mimetype="application/json")
-    else:
-      return render('not_running_spawning.mako', request, {})
-  shell_manager = ShellManager.global_instance()
-  user = request.user
-  if request.method == "POST":
-    key_name = request.POST.get(constants.KEY_NAME, "")
-  else:
-    key_name = request.GET.get(constants.KEY_NAME, "")
-  SHELL_INPUT_LOGGER.info("%s %s - Create '%s' shell" %
-                (request.META.get('REMOTE_ADDR'), user.username, key_name))
-  result = shell_manager.try_create(user, key_name)
-  if request.method == "POST":
-    return HttpResponse(simplejson.dumps(result), mimetype="application/json")
-  else:
-    if constants.SUCCESS in result:
-      shell_types = shell_manager.available_shell_types(user)
-      dict_for_template = { 'shells' : shell_types,
-                            'shell_id' : result.get(constants.SHELL_ID) }
-      return render('index.mako', request, dict_for_template)
-    else:
-      return render('failed_to_create.mako', request, {})
-
-def kill_shell(request):
-  if not _running_with_spawning(request):
-    result = simplejson.dumps({ constants.NOT_RUNNING_SPAWNING : True })
-    return HttpResponse(result, mimetype="application/json")
-  shell_manager = ShellManager.global_instance()
-  username = request.user.username
-  shell_id = request.POST[constants.SHELL_ID]
-  SHELL_INPUT_LOGGER.info("%s %s - shell_id:%s - Kill shell" %
-                 (request.META.get('REMOTE_ADDR'), username, shell_id))
-  result = shell_manager.kill_shell(username, shell_id)
-  return HttpResponse(result)
-
-def process_command(request):
-  if not _running_with_spawning(request):
-    result = simplejson.dumps({ constants.NOT_RUNNING_SPAWNING : True })
-    return HttpResponse(result, mimetype="application/json")
-  shell_manager = ShellManager.global_instance()
-  username = request.user.username
-  shell_id = request.POST[constants.SHELL_ID]
-  command = request.POST.get(constants.COMMAND, "")
-  SHELL_INPUT_LOGGER.info("%s %s - shell_id:%s - Command:'%s'" %
-              (request.META.get('REMOTE_ADDR'), username, shell_id, command))
-  result = shell_manager.process_command(username, shell_id, command)
-  return HttpResponse(simplejson.dumps(result), mimetype="application/json")
-
-def retrieve_output(request):
-  if not _running_with_spawning(request):
-    result = simplejson.dumps({ constants.NOT_RUNNING_SPAWNING : True })
-    return HttpResponse(result, mimetype="application/json")
-  shell_manager = ShellManager.global_instance()
-  username = request.user.username
-  hue_instance_id = request.META[constants.HUE_INSTANCE_ID]
-  try:
-    shell_pairs = utils.parse_shell_pairs(request)
-  except ValueError:
-    shell_pairs = []
-  result = shell_manager.retrieve_output(username, hue_instance_id, shell_pairs)
-  for key, value in result.iteritems():
-    if isinstance(value, dict) and constants.OUTPUT in value:
-      log_format = '%s %s - shell_id:%s - Output: "%s"'
-      log_args = (request.META.get('REMOTE_ADDR'), username, key,
-                                        repr(value[constants.OUTPUT]))
-      SHELL_OUTPUT_LOGGER.info(log_format % log_args)
-
-  for shell in result:
-    shell = result[shell]
-    if isinstance(shell, dict) and 'output' in shell:
-      shell['output'] = remove_colors(shell['output'])
-
-  return HttpResponse(simplejson.dumps(result), mimetype="application/json")
-
-def add_to_output(request):
-  if not _running_with_spawning(request):
-    result = simplejson.dumps({ constants.NOT_RUNNING_SPAWNING : True })
-    return HttpResponse(result, mimetype="application/json")
-  shell_manager = ShellManager.global_instance()
-  username = request.user.username
-  hue_instance_id = request.META[constants.HUE_INSTANCE_ID]
-  try:
-    shell_pairs = utils.parse_shell_pairs(request)
-  except ValueError:
-    shell_pairs = []
-  result = shell_manager.add_to_output(username, hue_instance_id, shell_pairs)
-  return HttpResponse(simplejson.dumps(result), mimetype="application/json")
-
-
-def remove_colors(text):
-  return re.sub('\x1b\[\d{0,3}(;\d{0,3})?m', '', text) # For Bash

+ 0 - 23
apps/shell/src/shell/windmilltests.py

@@ -1,23 +0,0 @@
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. 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.
-
-from desktop.lib.windmill_util import logged_in_client
-
-def test_shell():
-  """ launches the default view for shell """
-  client = logged_in_client()
-  client.click(id='hue-shell-menu')
-  client.waits.forElement(classname='Hue-SHELL', timeout='2000')

+ 0 - 5
desktop/conf.dist/hue.ini

@@ -39,11 +39,6 @@
   # Email backend
   ## django_email_backend=django.core.mail.backends.smtp.EmailBackend
 
-  # Set to true to use CherryPy as the webserver, set to false
-  # to use Spawning as the webserver. Defaults to Spawning if
-  # key is not specified.
-  ## use_cherrypy_server = false
-
   # Webserver runs as this user
   ## server_user=hue
   ## server_group=hue

+ 0 - 5
desktop/conf/pseudo-distributed.ini.tmpl

@@ -48,11 +48,6 @@
   # Email backend
   ## django_email_backend=django.core.mail.backends.smtp.EmailBackend
 
-  # Set to true to use CherryPy as the webserver, set to false
-  # to use Spawning as the webserver. Defaults to Spawning if
-  # key is not specified.
-  ## use_cherrypy_server = false
-
   # Webserver runs as this user
   ## server_user=hue
   ## server_group=hue

+ 0 - 9
desktop/core/ext-py/Spawning-0.9.6/AUTHORS.txt

@@ -1,9 +0,0 @@
-Authors
-
- - Donovan Preston (creator)
- - Ben Bangert (contributor)
- - Ludvig Ericson (contributor)
- - Elliot Murphy (contributor)
- - Steve 'Ashcrow' Milner (contributor)
- - Ryan Williams (contributor)
- - R. Tyler Croy (current maintainer)

+ 0 - 19
desktop/core/ext-py/Spawning-0.9.6/LICENSE.txt

@@ -1,19 +0,0 @@
-Copyright (c) 2008, Donovan Preston
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.

+ 0 - 4
desktop/core/ext-py/Spawning-0.9.6/MANIFEST.in

@@ -1,4 +0,0 @@
-include *.txt *.rst *.py
-recursive-include src/spawning *.py
-recursive-include src/Spawning.egg-info *
-recursive-include rc-scripts *

+ 0 - 115
desktop/core/ext-py/Spawning-0.9.6/NEWS.txt

@@ -1,115 +0,0 @@
-0.9
-====
-    - Remove the unnecessary dependency on eventlet.jsonhttp. This makes spawning work with eventlet 0.9, which removed jsonhttp and put it in another library. (fzzzy)
-    - Preserve the order of sys.path. (verterok)
-    - Work around a python deadlock bug with forked child processes (statik)
-
-0.9.1: Fix news file to move entries from 0.8.13 to 0.9 since I decided to call this release 0.9.
-
-0.9.2: Fix a small typo in the preserve order of sys.path patch from 0.9 that would cause spawning to crash. (schmir)
-
-0.9.3:
-    - Add the ability to disallow HTTP Keepalive via --no-keepalive
-    - Enable "progressive" spawning and reaping of children processes; in
-      effect the parent will receive a signal from children about their
-      impending death and the parent will spin up a new child while the old one
-      expires
-    - SIGHUP to the parent will cause it to cycle children without itself dying
-
-0.9.4:
-    - Script for spawning renamed from "spawn" to "spawning" to avoid confusion
-    - Use O_APPEND when opening files when daemonizing
-    - Debian/Ubuntu init.d scripts using start-stop-daemon
-    - spawning.util module added to house methods that don't belong elsewhere
-    - Update Spawning to use newer Eventlet API calls
-    - Properly handle errors when calling `setproctitle`
-    - Allow optional `eventlet.backdoor` bound to localhost
-    - Operate more cleanly with Eventlet's websockets support with changes to
-      eventlet.tpool integration
-    - Avoid passing certain objects through `eventlet.tpool.Proxy` when using
-      threads for a performance gain
-    - Prevent leaking pipes when handling children processes
-
-
-0.9.5:
-    - Fixed a number of issues with reloading of Spawning children
-    - Added /_sysinfo to provide information about the machine
-    - Added health page that listens on a different port from the controller,
-      providing HTML and JSON formatted information about children
-    - Introduced a basic logfile analyzer for processsing Spawning logs for
-      further information not provided by the health page
-
-
-
-0.8
-====
-
-Fixed a problem where eventlet monkeypatching was inappropriately installed in child processes which use threads. This would result in certain operations (primarily DNS lookup operations) resulting in a greenlet "cannot switch to another thread" exception.
-
-Changed the paste factory to use 10 worker threads by default, to match the paste default. Previously if the paste ini file did not mention how many worker threads to use, spawning would default to 0 and switch into cooperative, non-blocking mode.
-
-Added a deadman timeout to child processes which have been told to exit and are waiting for outstanding requests to finish. If the timeout expires before all requests have completed, we assume the process is hung and kill -9 it. The default timeout is 120 seconds.
-
-If an i/o child process dies with an exit code other than 0, the controller decides something must have gone horribly wrong and restarts all of the children.
-
-0.8.1: Fix a bug where the reloader didn't work with paster serve.
-
-0.8.2: In the svn reloader, watch both spawning's directory and the directory of the wsgi application we are serving. Also, fix the django_factory which was broken by 0.8.
-
-0.8.3: For all svn repositories the svn reloader is watching, also watch any svn:externals repositories contained therein.
-
-0.8.4: Fixed a bug where the controller process dying unexpectedly (such as from a kill -9) would cause the children to have an exception but then keep running forever, preventing any other processes from using the ports again in the future.
-
-0.8.5: Fixed a bug in the svn reloader where files that svn reported as 'not under version control' would cause the reloader to crash and exit immediately. I now use svn's exit code instead of sniffing svn's output, which should also help avoid problems for anyone who is using a localized copy of svn, or if svn ever changes the content of these messages.
-
-0.8.6: Fix a file descriptor leak that occurred when the controller reloaded. If your code changed enough times over the lifetime of the server (thousands of times) it would eventually run out of file descriptors and refuse to start up. Now the number of file descriptors stays constant no matter how many times the server restarts.
-
-0.8.7:
-  - In the svn reloader process, check to see if the controller is still alive, and if not, just exit.
-  - Don't hold on to the web port at all in the reloader_svn process.
-  - Add an exponential backoff to the controller's "panic" restart. Before spawning would restart as fast as possible; now it backs off the time between restarts.
-  - If we can't import the wsgi app, panic.
-  - If we can't fork a child process (out of memory), panic.
-
-0.8.8:
-  - Added --access-log-file command line option to allow writing access logs to someplace other than stdout. Useful for redirecting to /dev/null for speed
-  - Correctly extract the child's exit code and clean up the logging of child exit events.
-  - Add coverage gathering using figleaf if the --coverage command line option is given. When gathering coverage, the figleaf report can be downloaded from the /_coverage url.
-  - Add a --max-memory option to limit the total amount of memory spawning will use. If this is exceeded a SIGHUP will be sent to the controller causing the children to restart.
-  - Add a --max-age option to limit the total amount of time a spawning child is allowed to run. After the time limit is exceeded a SIGHUP will be sent to the controller to cause the children to restart.
-  - Instead of just passing the PYTHONPATH environment variable through to the children, construct the PYTHONPATH from the contents of sys.path.
-  - Instead of just trying to run 'spawn' with /usr/bin/env when restarting, just run sys.executable -m spawning.spawning_controller, making it more likely that the controller will run correctly when restarting.
-  - Add a --verbose option and change the default startup procedure to not log the detailed dictionary of configuration information.
-
-0.8.9: Minor release which provides compatibility with running servers which are using 0.8.7. With 0.8.8, any running servers which are upgraded from 0.8.7->0.8.8 will crash with a KeyError and need to be restarted manually.
-
-0.8.10: When spawning starts up, add the current working directory to sys.path if it is not already there. Also, when calculating the PYTHONPATH to give to the child from sys.path, remove any path which does not exist, preventing setuptools "DistributionNotFound" errors.
-
-0.8.11:
-    - Added Python 2.4 compatibility. (kiorky)
-    - Added license headers to all source files. (statik)
-    - Print exceptions to stderr instead of stdout. (lericson)
-    - Don't assume every OSError the controller process gets is EINTR. (lericson)
-    - Added simple daemonizing support. (lericson)
-    - Added an OpenRC init script. (lericson)
-    - Added an explicit manifest. (lericson)
-
-0.8.12:
-    - Remove the processpool implementation added in 0.7 because an equivalent setup can be achieved using controller processes and 1 thread; now we can just talk about the 'number of processes' and 'number of threads' instead of having two levels of different kind of processes when using the processpool. (fzzzy)
-    - Minor release to fix the explicit manifest and OpenRC init script added in the last release. (lericson)
-    - When running under 2.6 we no longer produce a deprecation warning about the removal of the sets module. (fzzzy)
-
-
-
-
-
-0.7
-====
-
-Added django_factory.
-
-Add an optional worker processpool which can be used as an equivalent to the worker threadpool.
-
-Added command-line script to launch a wsgi application, 'spawn'.
-
-	spawn mymodule.my_wsgi_app

+ 0 - 126
desktop/core/ext-py/Spawning-0.9.6/PKG-INFO

@@ -1,126 +0,0 @@
-Metadata-Version: 1.0
-Name: Spawning
-Version: 0.9.6
-Summary: Spawning is a wsgi server which supports multiple processes, multiple threads, green threads, non-blocking HTTP io, and automatic graceful upgrading of code.
-Home-page: UNKNOWN
-Author: R. Tyler Croy
-Author-email: tyler@monkeypox.org
-License: UNKNOWN
-Description: Spawning is a fast, easy to use, and flexible HTTP server for hosting python web applications which conform to the WSGI interface.
-        
-        Spawning uses eventlet to do non-blocking I/O for http requests and responses. This means the server will scale to a large number of idle keep-alive connections easily. Spawning can be configured to use multiple OS processes and either POSIX threads or eventlet's green threads, which are implemented using greenlet.
-        
-        Spawning is open source software, licensed under the MIT license. If you wish to contribute to development, please check out the source from http://github.com/rtyler/Spawning/ and either submit patches or fork spawning and submit a pull request.
-        
-        Single or Multiple Process
-        ==========================
-        
-        If your wsgi applications store state in memory, Spawning can be configured to run only one Python process. In this configuration your application state will be available to all requests but your application will not be able to take full advantage of multiple processors. Using multiple processes will take advantage of all processors and thus should be used for applications which do not share state.
-        
-        Single or Multiple Worker Thread
-        ================================================================
-        
-        If your wsgi applications perform a certain subset of blocking calls which have been monkeypatched by eventlet to cooperate instead (such as operations in the socket module), you can configure each process to run only a single main thread and cooperate using eventlet's green threads instead. This can be useful if your application needs to scale to a large number of simultaneous open connections, such as a COMET server or an application which uses AJAX polling. However, most existing wsgi applications will probably perform blocking operations (for example, calling database adapter libraries which perform blocking socket operations). Therefore, for most wsgi applications a combination of multiple processes and multiple threads will be ideal.
-        
-        Graceful Code Reloading
-        =======================
-        Spawning can watch all Python files that are imported into sys.modules for changes and performs a graceful reload on change. To enable this behavior, specify --reload=dev on the command line.  Old processes are told to stop accepting requests and finish any outstanding requests they are servicing, and shutdown. Meanwhile, new processes are started and begin accepting requests and servicing them with the new code. At no point will users of your site see "connection refused" errors because the server is continuously listening during reload.
-        
-        Running spawning
-        ================
-        
-        Spawning can be used to launch a wsgi application from the command line using the "spawn" script, or using Python Paste. To use with paste, specify use = egg:Spawning in the [server:main] section of a paste ini file.
-        
-        Spawning can also be used to run a Django application by using --factory=spawning.django_factory.config_factory.
-        
-        Examples of running spawning
-        ============================
-        
-        Run the wsgi application callable called "my_wsgi_application" inside the my_wsgi_module.py file::
-        
-          % spawning my_wsgi_module.my_wsgi_application
-        
-        Run whatever is configured inside of the paste-style configuration file development.ini. Equivalent to using paster serve with an ini file configured to use Spawning as the server::
-        
-          % spawning --factory=spawning.paste_factory.config_factory development.ini
-        
-        Run the Django app mysite::
-        
-          % spawning --factory=spawning.django_factory.config_factory mysite.settings
-        
-        Run the wsgi application wrapped with some middleware. Pass as many middleware strings as desired after the wsgi application name::
-        
-          % spawning my_wsgi_module.my_wsgi_application other_wsgi_module.some_wsgi_middleware
-        
-        Run the wsgi application on port 80, with 4 processes each using a threadpool of size 8::
-        
-          % sudo spawning --port=80 --processes=4 --threads=8 my_wsgi_module.my_wsgi_application
-        
-        Use a threadpool of size 0, which indicates that eventlet monkeypatching should be performed and wsgi applications should all be called in the same thread. Useful for writing a comet-style application where a lot of requests are simply waiting on a server-side event or internal network io to complete::
-        
-          % spawning --processes=4 --threads=0 my_wsgi_module.my_comet_application
-        
-        Additional Useful Arguments
-        ===========================
-        
-        -l ACCESS_LOG_FILE, --access-log-file=ACCESS_LOG_FILE
-        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-        
-            The file to log access log lines to. If not given, log
-            to stdout. Pass /dev/null to discard logs.
-        
-        -c, --coverage
-        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-        
-            If given, gather coverage data from the running
-            program and make the coverage report available from
-            the /_coverage url. See the figleaf docs for more
-            info: http://darcs.idyll.org/~t/projects/figleaf/doc/
-        
-        -m MAX_MEMORY, --max-memory=MAX_MEMORY
-        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-        
-            If given, the maximum amount of memory this instance
-            of Spawning is allowed to use. If all of the processes
-            started by this Spawning controller use more than this
-            amount of memory, send a SIGHUP to the controller to
-            get the children to restart.
-        
-        -a MAX_AGE, --max-age=MAX_AGE
-        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-        
-            If given, the maximum amount of time (in seconds) an
-            instance of spawning_child is allowed to run. Once
-            this time limit has expired a SIGHUP will be sent to
-            spawning_controller, causing it to restart all of the
-            child processes.
-        
-        --status-port=PORT, --status-host=HOST
-        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-        
-            If given, starts up a small web service to give 
-            health status reports on the Spawning server.  The 
-            service listens on two urls, 
-            
-            * http://status_host:status_port/status
-            * http://status_host:status_port/status.json
-            
-            The first is an HTML page that displays the status
-            of the server in a human-pleasing manner.  The .json
-            url is a JSON formatting of the same data.
-            
-            The status web service is only started if the 
-            --status-port option is supplied and different than
-            the service port.  --status-host is useful if
-            monitoring happens on a different ip address than
-            web application requests.
-        
-Platform: UNKNOWN
-Classifier: License :: OSI Approved :: MIT License
-Classifier: Programming Language :: Python
-Classifier: Operating System :: MacOS :: MacOS X
-Classifier: Operating System :: POSIX
-Classifier: Topic :: Internet
-Classifier: Topic :: Software Development :: Libraries :: Python Modules
-Classifier: Intended Audience :: Developers
-Classifier: Development Status :: 4 - Beta

+ 0 - 108
desktop/core/ext-py/Spawning-0.9.6/README.rst

@@ -1,108 +0,0 @@
-Spawning is a fast, easy to use, and flexible HTTP server for hosting python web applications which conform to the WSGI interface.
-
-Spawning uses eventlet to do non-blocking I/O for http requests and responses. This means the server will scale to a large number of idle keep-alive connections easily. Spawning can be configured to use multiple OS processes and either POSIX threads or eventlet's green threads, which are implemented using greenlet.
-
-Spawning is open source software, licensed under the MIT license. If you wish to contribute to development, please check out the source from http://github.com/rtyler/Spawning/ and either submit patches or fork spawning and submit a pull request.
-
-Single or Multiple Process
-==========================
-
-If your wsgi applications store state in memory, Spawning can be configured to run only one Python process. In this configuration your application state will be available to all requests but your application will not be able to take full advantage of multiple processors. Using multiple processes will take advantage of all processors and thus should be used for applications which do not share state.
-
-Single or Multiple Worker Thread
-================================================================
-
-If your wsgi applications perform a certain subset of blocking calls which have been monkeypatched by eventlet to cooperate instead (such as operations in the socket module), you can configure each process to run only a single main thread and cooperate using eventlet's green threads instead. This can be useful if your application needs to scale to a large number of simultaneous open connections, such as a COMET server or an application which uses AJAX polling. However, most existing wsgi applications will probably perform blocking operations (for example, calling database adapter libraries which perform blocking socket operations). Therefore, for most wsgi applications a combination of multiple processes and multiple threads will be ideal.
-
-Graceful Code Reloading
-=======================
-Spawning can watch all Python files that are imported into sys.modules for changes and performs a graceful reload on change. To enable this behavior, specify --reload=dev on the command line.  Old processes are told to stop accepting requests and finish any outstanding requests they are servicing, and shutdown. Meanwhile, new processes are started and begin accepting requests and servicing them with the new code. At no point will users of your site see "connection refused" errors because the server is continuously listening during reload.
-
-Running spawning
-================
-
-Spawning can be used to launch a wsgi application from the command line using the "spawn" script, or using Python Paste. To use with paste, specify use = egg:Spawning in the [server:main] section of a paste ini file.
-
-Spawning can also be used to run a Django application by using --factory=spawning.django_factory.config_factory.
-
-Examples of running spawning
-============================
-
-Run the wsgi application callable called "my_wsgi_application" inside the my_wsgi_module.py file::
-
-  % spawning my_wsgi_module.my_wsgi_application
-
-Run whatever is configured inside of the paste-style configuration file development.ini. Equivalent to using paster serve with an ini file configured to use Spawning as the server::
-
-  % spawning --factory=spawning.paste_factory.config_factory development.ini
-
-Run the Django app mysite::
-
-  % spawning --factory=spawning.django_factory.config_factory mysite.settings
-
-Run the wsgi application wrapped with some middleware. Pass as many middleware strings as desired after the wsgi application name::
-
-  % spawning my_wsgi_module.my_wsgi_application other_wsgi_module.some_wsgi_middleware
-
-Run the wsgi application on port 80, with 4 processes each using a threadpool of size 8::
-
-  % sudo spawning --port=80 --processes=4 --threads=8 my_wsgi_module.my_wsgi_application
-
-Use a threadpool of size 0, which indicates that eventlet monkeypatching should be performed and wsgi applications should all be called in the same thread. Useful for writing a comet-style application where a lot of requests are simply waiting on a server-side event or internal network io to complete::
-
-  % spawning --processes=4 --threads=0 my_wsgi_module.my_comet_application
-
-Additional Useful Arguments
-===========================
-
--l ACCESS_LOG_FILE, --access-log-file=ACCESS_LOG_FILE
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-    The file to log access log lines to. If not given, log
-    to stdout. Pass /dev/null to discard logs.
-
--c, --coverage
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-    If given, gather coverage data from the running
-    program and make the coverage report available from
-    the /_coverage url. See the figleaf docs for more
-    info: http://darcs.idyll.org/~t/projects/figleaf/doc/
-
--m MAX_MEMORY, --max-memory=MAX_MEMORY
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-    If given, the maximum amount of memory this instance
-    of Spawning is allowed to use. If all of the processes
-    started by this Spawning controller use more than this
-    amount of memory, send a SIGHUP to the controller to
-    get the children to restart.
-
--a MAX_AGE, --max-age=MAX_AGE
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-    If given, the maximum amount of time (in seconds) an
-    instance of spawning_child is allowed to run. Once
-    this time limit has expired a SIGHUP will be sent to
-    spawning_controller, causing it to restart all of the
-    child processes.
-
---status-port=PORT, --status-host=HOST
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-    If given, starts up a small web service to give 
-    health status reports on the Spawning server.  The 
-    service listens on two urls, 
-    
-    * http://status_host:status_port/status
-    * http://status_host:status_port/status.json
-    
-    The first is an HTML page that displays the status
-    of the server in a human-pleasing manner.  The .json
-    url is a JSON formatting of the same data.
-    
-    The status web service is only started if the 
-    --status-port option is supplied and different than
-    the service port.  --status-host is useful if
-    monitoring happens on a different ip address than
-    web application requests.

+ 0 - 167
desktop/core/ext-py/Spawning-0.9.6/pip-log.txt

@@ -1,167 +0,0 @@
-Downloading/unpacking distribute
-  Getting page http://pypi.python.org/simple/distribute
-  URLs to search for versions for distribute:
-  * http://pypi.python.org/simple/distribute/
-  Getting page http://packages.python.org/distribute
-  Analyzing links from page http://pypi.python.org/simple/distribute/
-    Found link http://pypi.python.org/packages/source/d/distribute/distribute-0.6.6.tar.gz#md5=a0a7541a8169d73842e4bb88d79cf8d3 (from http://pypi.python.org/simple/distribute/), version: 0.6.6
-    Found link http://pypi.python.org/packages/source/d/distribute/distribute-0.6.7.tar.gz#md5=b79b9422b1ea517bf3b43e277e9c813a (from http://pypi.python.org/simple/distribute/), version: 0.6.7
-    Found link http://pypi.python.org/packages/source/d/distribute/distribute-0.6.8.tar.gz#md5=c0c6a6b273234cb2cf8c4f82612e375c (from http://pypi.python.org/simple/distribute/), version: 0.6.8
-    Found link http://pypi.python.org/packages/source/d/distribute/distribute-0.6.10.tar.gz#md5=99fb4b3e4ef0861bba11aa1905e89fed (from http://pypi.python.org/simple/distribute/), version: 0.6.10
-    Skipping link http://pypi.python.org/packages/2.6/d/distribute/distribute-0.6-py2.6.egg#md5=89c46c2ed0c756dd278acc1482aa12f1 (from http://pypi.python.org/simple/distribute/); unknown archive format: .egg
-    Skipping link http://pypi.python.org/packages/2.4/d/distribute/distribute-0.6-py2.4.egg#md5=8fc3eb887ee98c506c38838955f9eee2 (from http://pypi.python.org/simple/distribute/); unknown archive format: .egg
-    Found link http://pypi.python.org/packages/source/d/distribute/distribute-0.6.4.tar.gz#md5=7a963679fddc64a0e363b2ccf8024952 (from http://pypi.python.org/simple/distribute/), version: 0.6.4
-    Found link http://pypi.python.org/packages/source/d/distribute/distribute-0.6.1.tar.gz#md5=e6224b1da4636dd8ae53407fc67bb35b (from http://pypi.python.org/simple/distribute/), version: 0.6.1
-    Found link http://pypi.python.org/packages/source/d/distribute/distribute-0.6.9.tar.gz#md5=5b1a2fde063a361aa241f98e0f9e1931 (from http://pypi.python.org/simple/distribute/), version: 0.6.9
-    Found link http://pypi.python.org/packages/source/d/distribute/distribute-0.6.2.tar.gz#md5=8e612376b1a0e4dfddcbcaefcc14515e (from http://pypi.python.org/simple/distribute/), version: 0.6.2
-    Found link http://pypi.python.org/packages/source/d/distribute/distribute-0.6.3.tar.gz#md5=3940fd02a763f001014296cfec5e69f2 (from http://pypi.python.org/simple/distribute/), version: 0.6.3
-    Found link http://pypi.python.org/packages/source/d/distribute/distribute-0.6.5.tar.gz#md5=ebe726123b35c1efbf5f7fc83116e3a1 (from http://pypi.python.org/simple/distribute/), version: 0.6.5
-    Found link http://pypi.python.org/packages/source/d/distribute/distribute-0.6.tar.gz#md5=698b898596fc35c95dbda8332cfca08b (from http://pypi.python.org/simple/distribute/), version: 0.6
-    Skipping link http://pypi.python.org/packages/2.5/d/distribute/distribute-0.6-py2.5.egg#md5=d87f6492c53d192c62e0334859d18b59 (from http://pypi.python.org/simple/distribute/); unknown archive format: .egg
-    Skipping link http://pypi.python.org/packages/2.3/d/distribute/distribute-0.6-py2.3.egg#md5=66d06db7fc91227585f81b0b27b07bab (from http://pypi.python.org/simple/distribute/); unknown archive format: .egg
-    Skipping link http://packages.python.org/distribute (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/1 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/10 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/12 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/13 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/16 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/18 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/3 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/31 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/40 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/49 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/5 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/50 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/52 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/56 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/6 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/7 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/8 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issue/9 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bitbucket.org/tarek/distribute/issues/ (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bugs.python.org/setuptools/issue2 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bugs.python.org/setuptools/issue20 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bugs.python.org/setuptools/issue33 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bugs.python.org/setuptools/issue39 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bugs.python.org/setuptools/issue40 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bugs.python.org/setuptools/issue41 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://bugs.python.org/setuptools/issue44 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://code.google.com/p/unladen-swallow/source/detail?spec=svn875&amp;r=719 (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://mail.python.org/mailman/listinfo/distutils-sig (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://packages.python.org (from http://pypi.python.org/simple/distribute/); not a file
-    Skipping link http://python-distribute.org/distribute_setup_3k.py (from http://pypi.python.org/simple/distribute/); unknown archive format: .py
-    Skipping link http://python-distribute.org/distribute_setup.py (from http://pypi.python.org/simple/distribute/); unknown archive format: .py
-    Found link http://bitbucket.org/tarek/distribute/get/0.6-maintenance.zip#egg=distribute-dev (from http://pypi.python.org/simple/distribute/), version: dev
-  Analyzing links from page http://packages.python.org/distribute/
-    Skipping link http://packages.python.org/distribute/_static/nature.css (from http://packages.python.org/distribute/); unknown archive format: .css
-    Skipping link http://packages.python.org/distribute/_static/pygments.css (from http://packages.python.org/distribute/); unknown archive format: .css
-    Skipping link http://packages.python.org/distribute/ (from http://packages.python.org/distribute/); not a file
-    Skipping link http://packages.python.org/distribute/roadmap.html (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/genindex.html (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/#welcome-to-distribute-s-documentation (from http://packages.python.org/distribute/); not a file
-    Skipping link http://pixane.com (from http://packages.python.org/distribute/); not a file
-    Skipping link http://packages.python.org/distribute/roadmap.html#x (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/roadmap.html#id1 (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/python3.html (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/python3.html#distribute-as-help-during-porting (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/python3.html#distributing-python-3-modules (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/python3.html#advanced-features (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/python3.html#note-on-compatibility-with-setuptools (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/using.html (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/setuptools.html (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/setuptools.html#developer-s-guide (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/setuptools.html#command-reference (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/setuptools.html#extending-and-reusing-distribute (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/easy_install.html (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/easy_install.html#using-easy-install (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/easy_install.html#reference-manual (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/easy_install.html#history (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/easy_install.html#future-plans (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/pkg_resources.html (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/pkg_resources.html#overview (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/pkg_resources.html#api-reference (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/#indices-and-tables (from http://packages.python.org/distribute/); not a file
-    Skipping link http://packages.python.org/distribute/modindex.html (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/search.html (from http://packages.python.org/distribute/); unknown archive format: .html
-    Skipping link http://packages.python.org/distribute/_sources/index.txt (from http://packages.python.org/distribute/); unknown archive format: .txt
-    Skipping link http://pypi.python.org/pypi/distribute (from http://packages.python.org/distribute/); not a file
-    Skipping link http://sphinx.pocoo.org/ (from http://packages.python.org/distribute/); not a file
-  Using version 0.6.10 (newest of versions: 0.6.10, 0.6.9, 0.6.8, 0.6.7, 0.6.6, 0.6.5, 0.6.4, 0.6.3, 0.6.2, 0.6.1, 0.6, dev)
-  Downloading from URL http://pypi.python.org/packages/source/d/distribute/distribute-0.6.10.tar.gz#md5=99fb4b3e4ef0861bba11aa1905e89fed (from http://pypi.python.org/simple/distribute/)
-  Running setup.py egg_info for package distribute
-    /usr/lib/python2.6/site-packages/Pyrex/Compiler/Errors.py:17: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
-      self.message = message
-    running egg_info
-    creating pip-egg-info/distribute.egg-info
-    writing pip-egg-info/distribute.egg-info/PKG-INFO
-    writing top-level names to pip-egg-info/distribute.egg-info/top_level.txt
-    writing dependency_links to pip-egg-info/distribute.egg-info/dependency_links.txt
-    writing entry points to pip-egg-info/distribute.egg-info/entry_points.txt
-    writing pip-egg-info/distribute.egg-info/PKG-INFO
-    writing top-level names to pip-egg-info/distribute.egg-info/top_level.txt
-    writing dependency_links to pip-egg-info/distribute.egg-info/dependency_links.txt
-    writing entry points to pip-egg-info/distribute.egg-info/entry_points.txt
-    writing manifest file 'pip-egg-info/distribute.egg-info/SOURCES.txt'
-    warning: manifest_maker: standard file '-c' not found
-    reading manifest file 'pip-egg-info/distribute.egg-info/SOURCES.txt'
-    reading manifest template 'MANIFEST.in'
-    writing manifest file 'pip-egg-info/distribute.egg-info/SOURCES.txt'
-Installing collected packages: distribute
-  Running setup.py install for distribute
-    Running command /home/tyler/envs/spawning/bin/python -c "import setuptools; __file__='/home/tyler/envs/spawning/build/distribute/setup.py'; execfile('/home/tyler/envs/spawning/build/distribute/setup.py')" install --single-version-externally-managed --record /tmp/pip-NyB_Gl-record/install-record.txt --install-headers /home/tyler/envs/spawning/lib/include
-    /usr/lib/python2.6/site-packages/Pyrex/Compiler/Errors.py:17: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
-      self.message = message
-    Before install bootstrap.
-    Scanning installed packages
-    Setuptools installation detected at /home/tyler/envs/spawning/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg
-    Egg installation
-    Patching...
-    Renaming /home/tyler/envs/spawning/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg into /home/tyler/envs/spawning/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg.OLD.1272815129.25
-    Patched done.
-    Relaunching...
-    Traceback (most recent call last):
-      File "<string>", line 1, in <module>
-    NameError: name 'install' is not defined
-    Complete output from command /home/tyler/envs/spawning/bin/python -c "import setuptools; __file__='/home/tyler/envs/spawning/build/distribute/setup.py'; execfile('/home/tyler/envs/spawning/build/distribute/setup.py')" install --single-version-externally-managed --record /tmp/pip-NyB_Gl-record/install-record.txt --install-headers /home/tyler/envs/spawning/lib/include:
-    /usr/lib/python2.6/site-packages/Pyrex/Compiler/Errors.py:17: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
-
-  self.message = message
-
-Before install bootstrap.
-
-Scanning installed packages
-
-Setuptools installation detected at /home/tyler/envs/spawning/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg
-
-Egg installation
-
-Patching...
-
-Renaming /home/tyler/envs/spawning/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg into /home/tyler/envs/spawning/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg.OLD.1272815129.25
-
-Patched done.
-
-Relaunching...
-
-Traceback (most recent call last):
-
-  File "<string>", line 1, in <module>
-
-NameError: name 'install' is not defined
-
-----------------------------------------
-Command /home/tyler/envs/spawning/bin/python -c "import setuptools; __file__='/home/tyler/envs/spawning/build/distribute/setup.py'; execfile('/home/tyler/envs/spawning/build/distribute/setup.py')" install --single-version-externally-managed --record /tmp/pip-NyB_Gl-record/install-record.txt --install-headers /home/tyler/envs/spawning/lib/include failed with error code 1
-Exception information:
-Traceback (most recent call last):
-  File "/home/tyler/envs/spawning/lib/python2.6/site-packages/pip-0.6.3-py2.6.egg/pip/basecommand.py", line 115, in main
-    self.run(options, args)
-  File "/home/tyler/envs/spawning/lib/python2.6/site-packages/pip-0.6.3-py2.6.egg/pip/commands/install.py", line 157, in run
-    requirement_set.install(install_options)
-  File "/home/tyler/envs/spawning/lib/python2.6/site-packages/pip-0.6.3-py2.6.egg/pip/req.py", line 1165, in install
-    requirement.install(install_options)
-  File "/home/tyler/envs/spawning/lib/python2.6/site-packages/pip-0.6.3-py2.6.egg/pip/req.py", line 533, in install
-    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
-  File "/home/tyler/envs/spawning/lib/python2.6/site-packages/pip-0.6.3-py2.6.egg/pip/__init__.py", line 207, in call_subprocess
-    % (command_desc, proc.returncode))
-InstallationError: Command /home/tyler/envs/spawning/bin/python -c "import setuptools; __file__='/home/tyler/envs/spawning/build/distribute/setup.py'; execfile('/home/tyler/envs/spawning/build/distribute/setup.py')" install --single-version-externally-managed --record /tmp/pip-NyB_Gl-record/install-record.txt --install-headers /home/tyler/envs/spawning/lib/include failed with error code 1

+ 0 - 67
desktop/core/ext-py/Spawning-0.9.6/rc-scripts/conf.d/spawning

@@ -1,67 +0,0 @@
-# Python Spawning configuration
-
-# DO NOT MODIFY THIS FILE DIRECTLY! CREATE A COPY AND MODIFY THAT INSTEAD!
-
-# Spawning factory name.
-# If you're using Django, you should use:
-#FACTORY=spawning.django_factory.config_factory.
-# If you're using Paste, you should use:
-#FACTORY=spawning.paste_factory.config_factory
-# Or, for regular WSGI, the default is:
-#FACTORY=spawning.wsgi_factory.config_factory
-
-# The WSGI application you want to spawn.
-# This means different things with different factories, for example with
-# Django, the WSGI_APP should be the Django settings module to load.
-WSGI_APP=
-
-# Serve on <HOST>:<PORT>
-HOST=0.0.0.0
-PORT=8080
-
-# Change to user (and group if given). `[user[:group]]`
-#CHUID=
-
-# A colon-separated list of the Python path.
-#PYTHON_LIBS=/usr/local/lib/my-python-packages
-
-# stderr is redirected to ERROR_LOG. The status output from the workers, among
-# other things, will end up there.
-ERROR_LOG=/var/log/spawning/error.log
-
-# stdout is redirected to INFO_LOG.
-INFO_LOG=/var/log/spawning/info.log
-
-# The access log is written separately from stdout and stderr.
-ACCESS_LOG=/var/log/spawning/access.log
-
-# Concurrency model.
-
-# Choose either forks (NUM_WORKERS) or threads (NUM_THREADS).
-# NUM_WORKERS defines the number of forks to make a process-based pool out of.
-#NUM_WORKERS=10
-#NUM_THREADS=0
-
-# NUM_THREADS defines the number of threads to make a thread-based pool out of.
-#NUM_THREADS=10
-#NUM_WORKERS=0
-
-# NUM_PROCS defines the number of forks to make, each fork has its own
-# NUM_WORKERS and NUM_THREADS.
-#NUM_PROCS=1
-
-# Maximum age in seconds of a worker before it's restarted.
-#MAX_AGE=
-
-# Maximum memory usage of _all_ workers before it's restarted.
-# Counts resident set size (RSS) in kilobytes, see ps(1).
-#MAX_MEMORY=
-
-# Watch file. When the file changes, Spawning reloads.
-#WATCH=
-
-# Extra options to pass to Spawning.
-#EXTRA_OPTS=
-
-# Path to Spawning binary.
-#SPAWN_BIN=

+ 0 - 91
desktop/core/ext-py/Spawning-0.9.6/rc-scripts/init.d/spawning

@@ -1,91 +0,0 @@
-#!/sbin/runscript
-# Copyright 2009 Ludvig Ericson
-# Distributed under the terms of the 3-clause BSD license
-
-[[ -z "${SPAWN_BIN}" ]] && SPAWN_BIN="$(which spawning)"
-PIDFILE="/var/run/${SVCNAME}.pid"
-
-opts="${opts} reload"
-
-depend() {
-	need net
-}
-
-check_params() {
-	if [[ "${SVCNAME}" == "spawning" && -z "${I_KNOW}" ]]; then
-		ewarn "It is highly recommended to use a symbolic link for this"
-		ewarn "script and start via that instead. This allows you to run"
-		ewarn "multiple spawn services simultaneously. To do this, simply:"
-		ewarn
-		ewarn "  ln -s /etc/init.d/spawning /etc/init.d/spawning.mysvc"
-		ewarn "  cp /etc/conf.d/spawning /etc/conf.d/spawning.mysvc"
-		ewarn
-		ewarn "If you don't want to be bothered by this message, set I_KNOW=yes"
-		ewarn "in your configuration file."
-		ewarn
-	fi
-
-	if [[ -z "${SPAWN_BIN}" ]]; then
-		eerror "Couldn't find spawning binary and no explicit"
-		eerror "path set in configuration file."
-		return 1
-	fi
-
-	for CONF_VAR in WSGI_APP HOST PORT ERROR_LOG; do
-		if [[ -z "$(eval echo \$${CONF_VAR})" ]]; then
-			eerror "Required configuration variable ${CONF_VAR} not"
-			eerror "set in configuration file."
-			return 1
-		fi
-	done
-
-	if [[ ! -z "${WORKERS}" && -z "${NUM_WORKERS}" ]]; then
-		eerror "WORKERS has changed name to NUM_WORKERS, please update"
-		eerror "your configuration file(s) accordingly."
-		return 1
-	fi
-}
-
-start() {
-	ebegin "Starting ${SVCNAME} on ${HOST}:${PORT}"
-	local OPTS
-
-	check_params || return 1
-
-	OPTS="${OPTS} --host ${HOST} --port ${PORT}"
-	[[ ! -z "${NUM_PROCS}" ]] && OPTS="${OPTS} --processes ${NUM_PROCS}"
-	if [[ ! -z "${NUM_THREADS}" ]]; then
-		OPTS="${OPTS} --threads ${NUM_THREADS}"
-	elif [[ ! -z "${NUM_WORKERS}" ]]; then
-		OPTS="${OPTS} --workers ${NUM_WORKERS}"
-	fi
-	OPTS="${OPTS} --access-log ${ACCESS_LOG:-/dev/null}"
-
-	[[ ! -z "${CHUID}" ]]		&& OPTS="${OPTS} --chuid ${CHUID}"
-	[[ ! -z "${FACTORY}" ]]		&& OPTS="${OPTS} --factory ${FACTORY}"
-	[[ ! -z "${WATCH}" ]]		&& OPTS="${OPTS} --watch ${WATCH}"
-	[[ ! -z "${MAX_MEMORY}" ]]	&& OPTS="${OPTS} --max-memory ${MAX_MEMORY}"
-	[[ ! -z "${MAX_AGE}" ]]		&& OPTS="${OPTS} --max-age ${MAX_AGE}"
-	OPTS="${OPTS} ${EXTRA_OPTS}"
-
-	start-stop-daemon --start --pidfile "${PIDFILE}" \
-		--exec "${SPAWN_BIN}" --env PYTHONPATH="${PYTHON_LIBS}" -- \
-			--daemonize --pidfile "${PIDFILE}" \
-			--stderr "${ERROR_LOG}" --stdout "${INFO_LOG:-/dev/null}" \
-			${OPTS} ${WSGI_APP}
-	eend $?
-}
-
-stop() {
-	check_params || return 1
-	ebegin "Stopping ${SVCNAME}"
-	start-stop-daemon --stop --pidfile "${PIDFILE}" --signal INT
-	eend $?
-}
-
-reload() {
-	check_params || return 1
-	ebegin "Telling ${SVCNAME} to reload itself"
-	kill -HUP "$(cat ${PIDFILE})"
-	eend $?
-}

+ 0 - 115
desktop/core/ext-py/Spawning-0.9.6/rc-scripts/init.d/spawning.debian

@@ -1,115 +0,0 @@
-#!/bin/bash
-
-### BEGIN INIT INFO
-# Provides:          spawning.debian
-# Required-Start:    $all
-# Required-Stop:     $all
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: starts a Spawning daemon
-# Description:       starts a Spawning daemon
-### END INIT INFO
-
-# Usage instructions:
-# - Copy this file to your /etc/init.d directory:
-#   $ sudo cp spawning.debian /etc/init.d/spawning.mysite
-# - Change the options below in the "Configuration" section.
-#   Spawning arguments currently supported are:
-#   - host (defaults to 127.0.0.1)
-#   - port (defaults to 8080)
-#   - access-log (defaults to /dev/null)
-#   - stderr (defaults to /dev/null)
-#   - chuid (optional)
-#   - factory (optional)
-#   - processes (optional)
-#   If you have additional arguments to provide (such as 
-#   max-age, watch, workers etc., add them as follows:
-#   EXTRA_ARGS="max-age=1000 --watch=file" etc.
-# - Initialise the script to survive reboots:
-#   $ sudo update-rc.d spawning.mysite defaults
-# - Start your server:
-#   $ sudo /etc/init.d/spawning.mysite start
-
-NAME="spawning.debian" # change debian to your own site
-DESC="Starts a Spawning daemon to run [domain here]"
-# This is where your app or settings.py lives
-SITE_DIR=/var/www/mysite/
-
-# CONFIGURATION - edit this stuff
-# Configure your own spawning here
-SPAWNING_BIN=/usr/local/bin/spawning #Path to Spawning executable
-PROCESSES=2 # Number of processes to spawn
-# Django by default: delete this var to run a WSGI app
-FACTORY="spawning.django_factory.config_factory"
-PORT="8080"
-HOST="127.0.0.1" # listen on loopback by default
-CHUID=""
-ACCESS_LOG=/dev/null
-ERROR_LOG=/dev/null
-APP="settings" # Django by default, but put your own app here
-# END CONFIGURATION
-
-# Don't edit this
-PIDFILE=/var/run/$NAME.pid
-
-# make sure the access_log file exists
-if [ ! -e $ACCESS_LOG ]; then
-    touch $ACCESS_LOG
-fi
-# make sure the error log file exists
-if [ ! -e $ERROR_LOG ]; then
-    touch $ERROR_LOG
-fi
-
-start() {
-    echo -n "Starting $NAME on $HOST:$PORT...: "
-    DAEMON_ARGS="--host=$HOST --port=$PORT"
-    DAEMON_ARGS="$DAEMON_ARGS --stderr=$ERROR_LOG --access-log-file=$ACCESS_LOG"
-    [ -n "$PROCESSES" ]  && DAEMON_ARGS="$DAEMON_ARGS --processes=$PROCESSES"
-    [ -n "$FACTORY" ]    && DAEMON_ARGS="$DAEMON_ARGS --factory=$FACTORY"
-    [ -n "$CHUID" ]      && DAEMON_ARGS="$DAEMON_ARGS --chuid=$CHUID"
-    [ -n "$EXTRA_ARGS" ] && DAEMON_ARGS="$DAEMON_ARGS $EXTRA_ARGS"
-    DAEMON_ARGS="$DAEMON_ARGS $APP"
-    /sbin/start-stop-daemon --start --background --make-pidfile --pidfile=$PIDFILE --chdir $SITE_DIR --exec $SPAWNING_BIN -- $DAEMON_ARGS || return 2
-    echo $NAME
-    return 0
-}
-
-stop () {
-    echo -n "Stopping $NAME: "
-    /sbin/start-stop-daemon --stop --pidfile $PIDFILE
-    rm -f $PIDFILE
-    echo $NAME
-    return
-}
-
-status() {
-    if [ -f "$PIDFILE" ]; then
-        echo -n "$NAME already running with PIDs: " && cat $PIDFILE && echo
-    else
-        echo "$NAME not running"
-    fi
-    return
-}
-
-case "$1" in
-    start)
-        start
-        ;;
-    stop)
-        stop
-        ;;
-    status)
-        status
-        ;;
-    restart)
-        stop
-        sleep 1
-        start
-        ;;
-    *)
-        echo "Usage: $NAME (start|stop|status|restart)"
-        exit 1
-        ;;
-esac
-exit $?

+ 0 - 5
desktop/core/ext-py/Spawning-0.9.6/setup.cfg

@@ -1,5 +0,0 @@
-[egg_info]
-tag_build = 
-tag_date = 0
-tag_svn_revision = 0
-

+ 0 - 74
desktop/core/ext-py/Spawning-0.9.6/setup.py

@@ -1,74 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2008, Donovan Preston
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-import sys
-
-# Insert src/ into our path so we can pull the version and include it
-sys.path.insert(0, 'src')
-from spawning import __version__
-
-from os import path
-
-from setuptools import find_packages, setup
-
-install_requires = ['eventlet >= 0.9.12',]
-
-try:
-    import json
-except ImportError:
-    install_requires.append('simplejson')
-
-setup(
-    name='Spawning',
-    description='Spawning is a wsgi server which supports multiple processes, multiple threads, green threads, non-blocking HTTP io, and automatic graceful upgrading of code.',
-    long_description=file(
-        path.join(
-            path.dirname(__file__),
-            'README.rst'
-        )
-    ).read(),
-    author='Donovan Preston',
-    author_email='dsposx@mac.com',
-    maintainer='R. Tyler Croy',
-    maintainer_email='tyler@monkeypox.org',
-    include_package_data = True,
-    packages = find_packages('src'),
-    package_dir = {'': 'src'},
-    version=__version__,
-    install_requires=install_requires,
-    entry_points={
-        'console_scripts': [],
-        'paste.server_factory': [
-            'main=spawning.paste_factory:server_factory'
-        ]
-    },
-    classifiers=[
-        "License :: OSI Approved :: MIT License",
-        "Programming Language :: Python",
-        "Operating System :: MacOS :: MacOS X",
-        "Operating System :: POSIX",
-        "Topic :: Internet",
-        "Topic :: Software Development :: Libraries :: Python Modules",
-        "Intended Audience :: Developers",
-        "Development Status :: 4 - Beta"
-    ]
-)
-

+ 0 - 37
desktop/core/ext-py/Spawning-0.9.6/src/spawning/__init__.py

@@ -1,37 +0,0 @@
-# Copyright (c) 2008, Donovan Preston
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-"""
-"""
-
-__version__ = '0.9.6'
-
-setproctitle = lambda v: NotImplemented
-
-try:
-    from setproctitle import setproctitle
-except ImportError:
-    try:
-        from procname import setprocname as setproctitle
-    except ImportError:
-        pass
-

+ 0 - 58
desktop/core/ext-py/Spawning-0.9.6/src/spawning/django_factory.py

@@ -1,58 +0,0 @@
-# Copyright (c) 2008, Donovan Preston
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-
-import inspect
-import os
-import django.core.handlers.wsgi
-from django.core.servers.basehttp import AdminMediaHandler
-
-import spawning.util
-
-def config_factory(args):
-    args['django_settings_module'] = args.get('args', [None])[0]
-    args['app_factory'] = 'spawning.django_factory.app_factory'
-
-    ## TODO More directories
-    ## INSTALLED_APPS (list of quals)
-    ## ROOT_URL_CONF (qual)
-    ## MIDDLEWARE_CLASSES (list of quals)
-    ## TEMPLATE_CONTEXT_PROCESSORS (list of quals)
-    settings_module = spawning.util.named(args['django_settings_module'])
-
-    dirs = [os.path.split(
-        inspect.getfile(
-            inspect.getmodule(
-                settings_module)))[0]]
-    args['source_directories'] = dirs
-
-    return args
-
-
-def app_factory(config):
-    os.environ['DJANGO_SETTINGS_MODULE'] = config['django_settings_module']
-
-    app = django.core.handlers.wsgi.WSGIHandler()
-    if config.get('dev'):
-        app = AdminMediaHandler(app)
-    return app
-

+ 0 - 94
desktop/core/ext-py/Spawning-0.9.6/src/spawning/memory_watcher.py

@@ -1,94 +0,0 @@
-# Copyright (c) 2008, Donovan Preston
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-import commands
-import os
-import optparse
-import signal
-import sys
-import time
-
-
-MEMORY_WATCH_INTERVAL = 60
-
-
-def watch_memory(controller_pid, max_memory, max_age):
-    if max_age:
-        end_time = time.time() + max_age
-    else:
-        end_time = None
-
-    process_group = os.getpgrp()
-    while True:
-        if max_age:
-            now = time.time()
-            if now + MEMORY_WATCH_INTERVAL > end_time:
-                time.sleep(end_time - now)
-                print "(%s) *** watcher restarting processes! Time limit exceeded." % (
-                    os.getpid(), )
-                os.kill(controller_pid, signal.SIGHUP)
-                end_time = time.time() + max_age
-                continue
-
-        time.sleep(MEMORY_WATCH_INTERVAL)
-        if max_memory:
-            out = commands.getoutput('ps -o rss -g %s' % (process_group, ))
-            used_mem = sum(int(x) for x in out.split('\n')[1:])
-            if used_mem > max_memory:
-                print "(%s) *** memory watcher restarting processes! Memory usage of %s exceeded %s." % (
-                    os.getpid(), used_mem, max_memory)
-                os.kill(controller_pid, signal.SIGHUP)
-
-
-if __name__ == '__main__':
-    parser = optparse.OptionParser(
-        description="Watch all the processes in the process group"
-        " and if the total memory used goes over a configurable amount, send a SIGHUP"
-        " to a given pid.")
-    parser.add_option('-a', '--max-age', dest='max_age', type='int',
-        help='If given, the maximum amount of time (in seconds) to run before sending a  '
-            'SIGHUP to the given pid.')
-
-    options, positional_args = parser.parse_args()
-
-    if len(positional_args) < 2:
-        parser.error("Usage: %s controller_pid max_memory_in_megabytes")
-
-    controller_pid = int(positional_args[0])
-    max_memory = int(positional_args[1])
-    if max_memory:
-        info = 'memory to %s' % (max_memory, )
-    else:
-        info = ''
-
-    if options.max_age:
-        if info:
-            info += ' and'
-        info = " time to %s" % (options.max_age, )
-
-    print "(%s) watcher starting up, limiting%s." % (
-        os.getpid(), info)
-
-    try:
-        watch_memory(controller_pid, max_memory, options.max_age)
-    except KeyboardInterrupt:
-        pass

+ 0 - 102
desktop/core/ext-py/Spawning-0.9.6/src/spawning/paste_factory.py

@@ -1,102 +0,0 @@
-# Copyright (c) 2008, Donovan Preston
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-import os
-import sys
-
-from paste.deploy import loadwsgi
-
-from spawning import spawning_controller
-
-
-def config_factory(args):
-    if 'config_url' in args:
-        config_url = args['config_url']
-        relative_to = args['relative_to']
-        global_conf = args['global_conf']
-    else:
-        config_file = os.path.abspath(args['args'][0])
-        config_url = 'config:%s' % (os.path.basename(config_file), )
-        relative_to = os.path.dirname(config_file)
-        global_conf = {}
-        for arg in args['args'][1:]:
-            key, value = arg.split('=')
-            global_conf[key] = value
-
-    ctx = loadwsgi.loadcontext(
-        loadwsgi.SERVER,
-        config_url,
-        relative_to=relative_to,
-        global_conf=global_conf)
-
-    watch = args.get('watch', None)
-    if watch is None:
-        watch = []
-    if ctx.global_conf['__file__'] not in watch:
-        watch.append(ctx.global_conf['__file__'])
-    args['watch'] = watch
-
-    args['app_factory'] = 'spawning.paste_factory.app_factory'
-    args['config_url'] = config_url
-    args['relative_to'] = relative_to
-    args['source_directories'] = [relative_to]
-    args['global_conf'] = ctx.global_conf
-
-    debug = ctx.global_conf.get('debug', None)
-    if debug is not None:
-        args['dev'] = (debug == 'true')
-    host = ctx.local_conf.get('host', None)
-    if host is not None:
-        args['host'] = host
-    port = ctx.local_conf.get('port', None)
-    if port is not None:
-        args['port'] = int(port)
-    num_processes = ctx.local_conf.get('num_processes', None)
-    if num_processes is not None:
-        args['num_processes'] = int(num_processes)
-    threadpool_workers = ctx.local_conf.get('threadpool_workers', None)
-    if threadpool_workers is not None:
-        args['threadpool_workers'] = int(threadpool_workers)
-
-    return args
-
-
-def app_factory(config):
-    return loadwsgi.loadapp(
-        config['config_url'],
-        relative_to=config['relative_to'],
-        global_conf=config['global_conf'])
-
-
-def server_factory(global_conf, host, port, *args, **kw):
-    config_url = 'config:' + os.path.split(global_conf['__file__'])[1]
-    relative_to = global_conf['here']
-
-    def run(app):
-        args = spawning_controller.DEFAULTS.copy()
-        args.update(
-            {'config_url': config_url, 'relative_to': relative_to, 'global_conf': global_conf})
-
-        spawning_controller.run_controller(
-            'spawning.paste_factory.config_factory', args)
-
-    return run

+ 0 - 119
desktop/core/ext-py/Spawning-0.9.6/src/spawning/reloader_dev.py

@@ -1,119 +0,0 @@
-# Copyright (c) 2008, Donovan Preston
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-"""Watch files and send a SIGHUP signal to another process
-if any of the files change.
-"""
-
-try:
-	set
-except NameError:
-	import sets
-	set = sets.Set
-
-import optparse, os, signal, sys, tempfile, time
-from os.path import join
-from distutils import sysconfig
-
-import eventlet
-
-try:
-    from procname import setprocname
-except ImportError, e:
-    setprocname = lambda n: None
-
-def watch_forever(pid, interval, files=None):
-    """
-    """
-    limiter = eventlet.GreenPool()
-    module_mtimes = {}
-    last_changed_time = None
-    while True:
-        uniques = set()
-
-        uniques.add(join(sysconfig.get_python_lib(), 'easy-install.pth'))
-        uniques.update(list(get_sys_modules_files()))
-
-        if files:
-            uniques.update(files)
-        ##print uniques
-        changed = False
-        for filename in uniques:
-            try:
-                stat = os.stat(filename)
-                if stat:
-                    mtime = stat.st_mtime
-                else:
-                    mtime = 0
-            except (OSError, IOError):
-                continue
-            if filename.endswith('.pyc') and os.path.exists(filename[:-1]):
-                mtime = max(os.stat(filename[:-1]).st_mtime, mtime)
-            if not module_mtimes.has_key(filename):
-                module_mtimes[filename] = mtime
-            elif module_mtimes[filename] < mtime:
-                changed = True
-                last_changed_time = mtime
-                module_mtimes[filename] = mtime
-                print "(%s) * File %r changed" % (os.getpid(), filename)
-
-        if not changed and last_changed_time is not None:
-            last_changed_time = None
-            if pid:
-                print "(%s) ** Sending SIGHUP to %s at %s" % (
-                    os.getpid(), pid, time.asctime())
-                os.kill(pid, signal.SIGHUP)
-                return ## this process is going to die now, no need to keep watching
-            else:
-                print "EXIT??!!!"
-                os._exit(5)
-
-        eventlet.sleep(interval)
-
-
-def get_sys_modules_files():
-    for module in sys.modules.values():
-        fn = getattr(module, '__file__', None)
-        if fn is not None:
-            yield os.path.abspath(fn)
-
-
-def main():
-    parser = optparse.OptionParser()
-    parser.add_option("-p", "--pid",
-        type="int", dest="pid",
-        help="A pid to SIGHUP when a monitored file changes. "
-        "If not given, just print a message to stdout and kill this process instead.")
-    parser.add_option("-i", "--interval",
-        type="int", dest="interval",
-        help="The time to wait between scans, in seconds.", default=1)
-    options, args = parser.parse_args()
-
-    try:
-        watch_forever(options.pid, options.interval)
-    except KeyboardInterrupt:
-        pass
-
-
-if __name__ == '__main__':
-    main()
-

+ 0 - 143
desktop/core/ext-py/Spawning-0.9.6/src/spawning/reloader_svn.py

@@ -1,143 +0,0 @@
-# Copyright (c) 2008, Donovan Preston
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-"""Watch the svn revision returned from svn info and send a SIGHUP
-to a process when the revision changes.
-"""
-
-
-import commands, optparse, os, signal, sys, tempfile, time
-
-try:
-    from procname import setprocname
-except ImportError, e:
-    setprocname = lambda n: None
-
-
-def get_revision(directory):
-    cmd = 'svn info'
-    if directory is not None:
-        cmd = '%s %s' % (cmd, directory)
-
-    try:
-        out = commands.getoutput(cmd).split('\n')
-    except IOError:
-        return
-
-    for line in out:
-        if line.startswith('Revision: '):
-            return int(line[len('Revision: '):])
-
-
-def watch_forever(directories, pid, interval):
-    setprocname("spawn: svn reloader")
-    if directories is None:
-        directories = ['.']
-    ## Look for externals
-    all_svn_repos = set(directories)
-
-    def visit(parent, subdirname, children):
-        if '.svn' in children:
-            children.remove('.svn')
-        status, out = commands.getstatusoutput('svn propget svn:externals %s' % (subdirname, ))
-        if status:
-            return
-
-        for line in out.split('\n'):
-            line = line.strip()
-            if not line:
-                continue
-            name, _external_url = line.split()
-            fulldir = os.path.join(parent, subdirname, name)
-            ## Don't keep going into the external in the walk()
-            try:
-                children.remove(name)
-            except ValueError:
-                print "*** An entry in svn externals doesn't exist, ignoring:", name
-            else:
-                directories.append(fulldir)
-                all_svn_repos.add(fulldir)
-
-    while directories:
-        dirname = directories.pop(0)
-        os.path.walk(dirname, visit, dirname)
-
-    revisions = {}
-    for dirname in all_svn_repos:
-        revisions[dirname] = get_revision(dirname)
-
-    print "(%s) svn watcher watching directories: %s" % (
-        os.getpid(), list(all_svn_repos))
-
-    while True:
-        if pid:
-            ## Check to see if our controller is still alive; if not, just exit.
-            try:
-                os.getpgid(pid)
-            except OSError:
-                print "(%s) reloader_svn is orphaned; controller %s no longer running. Exiting." % (
-                    os.getpid(), pid)
-                os._exit(0)
-
-        for dirname in all_svn_repos:
-            new_revision = get_revision(dirname)
-
-            if new_revision is not None and new_revision != revisions[dirname]:
-                revisions[dirname] = new_revision
-                if pid:
-                    print "(%s) * SVN revision changed on %s to %s; Sending SIGHUP to %s at %s" % (
-                        os.getpid(), dirname, new_revision, pid, time.asctime())
-                    os.kill(pid, signal.SIGHUP)
-                    os._exit(0)
-                else:
-                    print "(%s) Revision changed, dying at %s" % (
-                        os.getpid(), time.asctime())
-                    os._exit(5)
-
-        time.sleep(interval)
-
-
-def main():
-    parser = optparse.OptionParser()
-    parser.add_option("-d", "--dir", dest='dirs', action="append",
-        help="The directories to do svn info in. If not given, use cwd.")
-    parser.add_option("-p", "--pid",
-        type="int", dest="pid",
-        help="A pid to SIGHUP when the svn revision changes. "
-        "If not given, just print a message to stdout and kill this process instead.")
-    parser.add_option("-i", "--interval",
-        type="int", dest="interval",
-        help="The time to wait between scans, in seconds.", default=10)
-    options, args = parser.parse_args()
-
-    print "(%s) svn watcher running, controller pid %s" % (os.getpid(), options.pid)
-    if options.pid is None:
-        options.pid = os.getpid()
-    try:
-        watch_forever(options.dirs, int(options.pid), options.interval)
-    except KeyboardInterrupt:
-        pass
-
-
-if __name__ == '__main__':
-    main()
-

+ 0 - 341
desktop/core/ext-py/Spawning-0.9.6/src/spawning/spawning_child.py

@@ -1,341 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2008, Donovan Preston
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-"""spawning_child.py
-"""
-
-import eventlet
-import eventlet.event
-import eventlet.greenio
-import eventlet.greenthread
-import eventlet.hubs
-import eventlet.wsgi
-
-import errno
-import optparse
-import os
-import signal
-import socket
-import sys
-import time
-
-import spawning.util
-from spawning import setproctitle, reloader_dev
-
-try:
-    import simplejson as json
-except ImportError:
-    import json
-
-
-class URLInterceptor(object):
-    """
-    Intercepts one or more paths.
-    """
-
-    paths = []
-
-    def __init__(self, app, paths=[]):
-        """
-        Creates an instance.
-
-        :Parameters:
-           - `app`: Application to fall through to
-        """
-        self.app = app
-
-    def _intercept(self, env, start_response):
-        """
-        Executes business logic.
-
-        :Parameters:
-           - `env`: environment information
-           - `start_response`: wsgi response function
-        """
-        raise NotImplementedError('_intercept must be overridden')
-
-    def __call__(self, env, start_response):
-        """
-        Dispatches input to the proper method.
-
-        :Parameters:
-           - `env`: environment information
-           - `start_response`: wsgi response function
-        """
-        if env['PATH_INFO'] in self.paths:
-            return self._intercept(env, start_response)
-        return self.app(env, start_response)
-
-
-class FigleafCoverage(URLInterceptor):
-
-    paths = ['/_coverage']
-
-    def __init__(self, app):
-        URLInterceptor.__init__(self, app)
-        import figleaf
-        figleaf.start()
-
-    def _intercept(self, env, start_response):
-        import figleaf
-        try:
-            import cPickle as pickle
-        except ImportError:
-            import pickle
-
-        coverage = figleaf.get_info()
-        s = pickle.dumps(coverage)
-        start_response("200 OK", [('Content-type', 'application/x-pickle')])
-        return [s]
-
-
-class SystemInfo(URLInterceptor):
-    """
-    Intercepts /_sysinfo path and returns json data.
-    """
-
-    paths = ['/_sysinfo']
-
-    def _intercept(self, env, start_response):
-        """
-        Executes business logic.
-
-        :Parameters:
-           - `env`: environment information
-           - `start_response`: wsgi response function
-        """
-        import spawning.util.system
-        start_response("200 OK", [('Content-type', 'application/json')])
-        return [json.dumps(spawning.util.system.System())]
-
-
-class ExitChild(Exception):
-    pass
-
-class ChildStatus(object):
-    def __init__(self, controller_port):
-        self.controller_url =  "http://127.0.0.1:%s/" % controller_port
-        self.server = None
-        
-    def send_status_to_controller(self):
-        try:
-            child_status = {'pid':os.getpid()}
-            if self.server: 
-                child_status['concurrent_requests'] = \
-                    self.server.outstanding_requests
-            else:
-                child_status['error'] = 'Starting...'
-            body = json.dumps(child_status)
-            import urllib2
-            urllib2.urlopen(self.controller_url, body)
-        except (KeyboardInterrupt, SystemExit,
-             eventlet.greenthread.greenlet.GreenletExit):
-            raise
-        except Exception, e:  
-            # we really don't want exceptions here to stop read_pipe_and_die
-            pass
-
-_g_status = None
-def init_statusobj(status_port):
-    global _g_status
-    if status_port:
-        _g_status = ChildStatus(status_port)
-def get_statusobj():
-    return _g_status
-
-
-def read_pipe_and_die(the_pipe, server_coro):
-    dying = False
-    try:
-        while True:
-            eventlet.hubs.trampoline(the_pipe, read=True)
-            c = os.read(the_pipe, 1)
-            # this is how the controller tells the child to send a status update
-            if c == 's' and get_statusobj():
-                get_statusobj().send_status_to_controller()
-            elif not dying:
-                dying = True  # only send ExitChild once
-                eventlet.greenthread.kill(server_coro, ExitChild)
-                # continue to listen for status pings while dying
-    except socket.error:
-        pass
-    # if here, perhaps the controller's process went down; we should die too if
-    # we aren't already
-    if not dying:
-        eventlet.greenthread.kill(server_coro, KeyboardInterrupt)
-
-def tpool_wsgi(app):
-    from eventlet import tpool
-    def tpooled_application(e, s):
-        result = tpool.execute(app, e, s)
-        # return builtins directly
-        if isinstance(result, (basestring, list, tuple)):
-            return result
-        else:
-            # iterators might execute code when iterating over them,
-            # so we wrap them in a Proxy object so every call to
-            # next() goes through tpool
-            return tpool.Proxy(result)
-    return tpooled_application
-
-
-def warn_controller_of_imminent_death(controller_pid):
-    # The controller responds to a SIGUSR1 by kicking off a new child process.
-    try:
-        os.kill(controller_pid, signal.SIGUSR1)
-    except OSError, e:
-        if not e.errno == errno.ESRCH:
-            raise
-
-
-def serve_from_child(sock, config, controller_pid):
-    threads = config.get('threadpool_workers', 0)
-    wsgi_application = spawning.util.named(config['app_factory'])(config)
-
-    if config.get('coverage'):
-        wsgi_application = FigleafCoverage(wsgi_application)
-    if config.get('sysinfo'):
-        wsgi_application = SystemInfo(wsgi_application)
-
-    if threads >= 1:
-        # proxy calls of the application through tpool
-        wsgi_application = tpool_wsgi(wsgi_application)
-    elif threads != 1:
-        from eventlet.green import socket
-
-    host, port = sock.getsockname()
-
-    access_log_file = config.get('access_log_file')
-    if access_log_file is not None:
-        access_log_file = open(access_log_file, 'a')
-
-    max_age = 0
-    if config.get('max_age'):
-        max_age = int(config.get('max_age'))
-
-    server_event = eventlet.event.Event()
-    # the status object wants to have a reference to the server object
-    if config.get('status_port'):
-        def send_server_to_status(server_event):
-            server = server_event.wait()
-            get_statusobj().server = server
-        eventlet.spawn(send_server_to_status, server_event)
-
-    http_version = config.get('no_keepalive') and 'HTTP/1.0' or 'HTTP/1.1'
-    try:
-        wsgi_args = (sock, wsgi_application)
-        wsgi_kwargs = {'log' : access_log_file, 'server_event' : server_event, 'max_http_version' : http_version}
-        if config.get('no_keepalive'):
-            wsgi_kwargs.update({'keepalive' : False})
-        if max_age:
-            wsgi_kwargs.update({'timeout_value' : True})
-            eventlet.with_timeout(max_age, eventlet.wsgi.server, *wsgi_args,
-                    **wsgi_kwargs)
-            warn_controller_of_imminent_death(controller_pid)
-        else:
-            eventlet.wsgi.server(*wsgi_args, **wsgi_kwargs)
-    except KeyboardInterrupt:
-        # controller probably doesn't know that we got killed by a SIGINT
-        warn_controller_of_imminent_death(controller_pid)
-    except ExitChild:
-        pass  # parent killed us, it already knows we're dying
-
-    ## Once we get here, we should not accept any new sockets, so we should close the server socket.
-    sock.close()
-    
-    server = server_event.wait()
-
-    print "(%s) *** Child exiting" % (os.getpid(),)
-    os.kill(os.getpid(), signal.SIGKILL)
-
-def child_sighup(*args, **kwargs):
-    exit(0)
-
-
-def main():
-    parser = optparse.OptionParser()
-    parser.add_option("-r", "--reload",
-        action='store_true', dest='reload',
-        help='If --reload is passed, reload the server any time '
-        'a loaded module changes.')
-    parser.add_option('--ssl-certificate', dest='ssl_certificate', type='string', default='',
-        help='Absolute path to SSL certificate file.')
-    parser.add_option('--ssl-private-key', dest='ssl_private_key', type='string', default='',
-        help='Absolute path to SSL private key.')
-
-    options, args = parser.parse_args()
-
-    if len(args) != 5:
-        print "Usage: %s controller_pid httpd_fd death_fd factory_qual factory_args" % (
-            sys.argv[0], )
-        sys.exit(1)
-
-    controller_pid, httpd_fd, death_fd, factory_qual, factory_args = args
-    controller_pid = int(controller_pid)
-    config = spawning.util.named(factory_qual)(json.loads(factory_args))
-
-    setproctitle("spawn: child (%s)" % ", ".join(config.get("args")))
-    
-    ## Set up status reporter, if requested
-    init_statusobj(config.get('status_port'))
-
-    ## Set up the reloader
-    if config.get('reload'):
-        watch = config.get('watch', None)
-        if watch:
-            watching = ' and %s' % watch
-        else:
-            watching = ''
-        print "(%s) reloader watching sys.modules%s" % (os.getpid(), watching)
-        eventlet.spawn(
-            reloader_dev.watch_forever, controller_pid, 1, watch)
-
-    ## The parent will catch sigint and tell us to shut down
-    signal.signal(signal.SIGINT, signal.SIG_IGN)
-    ## Expect a SIGHUP when we want the child to die
-    signal.signal(signal.SIGHUP, child_sighup)
-    eventlet.spawn(read_pipe_and_die, int(death_fd), eventlet.getcurrent())
-
-    ## Make the socket object from the fd given to us by the controller
-    sock = eventlet.greenio.GreenSocket(
-        socket.fromfd(int(httpd_fd), socket.AF_INET, socket.SOCK_STREAM))
-
-    if options.ssl_certificate and options.ssl_private_key:
-        # The way spawning works is that there's a parent process which forks off long-lived
-        # children, each of which can be multithreaded. What we're using is a single-threaded,
-        # single-process server that does things asynchronously (using coroutines). Spawning creates
-        # a socket and then calls fork() at least once. In the child process, it exec()'s something
-        # else, so as a result the child loses all context. It puts the file descriptor for the
-        # socket as a command-line argument to the child, which then uses the fromfd function of the
-        # socket module to create a socket object. Unfortunately, the resulting object isn't quite
-        # the same as the socket created by the parent. In particular, when we go to upgrade this
-        # socket to ssl using eventlet's wrap_with_ssl(), it fails because it expects sock.fd to be
-        # of type "socket._socketobject", but it's actually of type "_socket.socket". Patching
-        # up the object in this way solves this problem.
-        sock.fd = socket._socketobject(_sock=sock.fd)
-        sock = eventlet.wrap_ssl(sock, certfile=options.ssl_certificate, keyfile=options.ssl_private_key, server_side=True)
-
-    serve_from_child(sock, config, controller_pid)
-
-if __name__ == '__main__':
-    main()

+ 0 - 521
desktop/core/ext-py/Spawning-0.9.6/src/spawning/spawning_controller.py

@@ -1,521 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2008, Donovan Preston
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-import eventlet
-
-import commands
-import datetime
-import errno
-import logging
-import optparse
-import pprint
-import signal
-from eventlet.green import socket
-import sys
-from eventlet.green import time
-import traceback
-
-try:
-    import simplejson as json
-except ImportError:
-    import json
-
-
-import eventlet.backdoor
-from eventlet.green import os
-
-import spawning
-import spawning.util
-
-KEEP_GOING = True
-RESTART_CONTROLLER = False
-PANIC = False
-
-
-DEFAULTS = {
-    'num_processes': 4,
-    'threadpool_workers': 4,
-    'watch': [],
-    'dev': True,
-    'host': '',
-    'port': 8080,
-    'max_memory': None,
-}
-
-def print_exc(msg="Exception occured!"):
-    print >>sys.stderr, "(%d) %s" % (os.getpid(), msg)
-    traceback.print_exc()
-
-def environ():
-    env = os.environ.copy()
-    # to avoid duplicates in the new sys.path
-    revised_paths = set()
-    new_path = list()
-    for path in sys.path:
-        if os.path.exists(path) and path not in revised_paths:
-            revised_paths.add(path)
-            new_path.append(path)
-    current_directory = os.path.realpath('.')
-    if current_directory not in revised_paths:
-        new_path.append(current_directory)
-
-    env['PYTHONPATH'] = ':'.join(new_path)
-    return env
-
-class Child(object):
-    def __init__(self, pid, kill_pipe):
-        self.pid = pid
-        self.kill_pipe = kill_pipe
-        self.active = True
-        self.forked_at = datetime.datetime.now()
-
-class Controller(object):
-    sock = None
-    factory = None
-    args = None
-    config = None
-    children = None
-    keep_going = True
-    panic = False
-    log = None
-    controller_pid = None
-    num_processes = 0
-
-    def __init__(self, sock, factory, args, **kwargs):
-        self.sock = sock
-        self.factory = factory
-        self.config = spawning.util.named(factory)(args)
-        self.args = args
-        self.children = {}
-        self.log = logging.getLogger('Spawning')
-        if not kwargs.get('log_handler'):
-            self.log.addHandler(logging.StreamHandler())
-        self.log.setLevel(logging.DEBUG)
-        self.controller_pid = os.getpid()
-        self.num_processes = int(self.config.get('num_processes', 0))
-        self.started_at = datetime.datetime.now()
-
-    def spawn_children(self, number=1):
-        parent_pid = os.getpid()
-        self.log.debug('Controller.spawn_children(number=%d)' % number)
-
-        for i in range(number):
-            child_side, parent_side = os.pipe()
-            try:
-                child_pid = os.fork()
-            except:
-                print_exc('Could not fork child! Panic!')
-                ### TODO: restart
-
-            if not child_pid:      # child process
-                os.close(parent_side)
-                command = [sys.executable, '-c',
-                    'import sys; from spawning import spawning_child; spawning_child.main()',
-                    str(parent_pid),
-                    str(self.sock.fileno()),
-                    str(child_side),
-                    self.factory,
-                    json.dumps(self.args)]
-                if self.args['reload'] == 'dev':
-                    command.append('--reload')
-		if self.args.get('ssl_private_key') and self.args.get('ssl_certificate'):
-                    command.append('--ssl-private-key')
-                    command.append(self.args.get('ssl_private_key'))
-                    command.append('--ssl-certificate')
-                    command.append(self.args.get('ssl_certificate'))
-                env = environ()
-                tpool_size = int(self.config.get('threadpool_workers', 0))
-                assert tpool_size >= 0, (tpool_size, 'Cannot have a negative --threads argument')
-                if not tpool_size in (0, 1):
-                    env['EVENTLET_THREADPOOL_SIZE'] = str(tpool_size)
-                os.execve(sys.executable, command, env)
-
-            # controller process
-            os.close(child_side)
-            self.children[child_pid] = Child(child_pid, parent_side)
-
-    def children_count(self):
-        return len(self.children)
-
-    def runloop(self):
-        while self.keep_going:
-            eventlet.sleep(0.1)
-            ## Only start the number of children we need
-            number = self.num_processes - self.children_count()
-            if number > 0:
-                self.log.debug('Should start %d new children', number)
-                self.spawn_children(number=number)
-                continue
-
-            if not self.children:
-                ## If we don't yet have children, let's loop
-                continue
-
-            pid, result = None, None
-            try:
-                pid, result = os.wait()
-            except OSError, e:
-                if e.errno != errno.EINTR:
-                    raise
-
-            if pid and self.children.get(pid):
-                try:
-                    child = self.children.pop(pid)
-                    os.close(child.kill_pipe)
-                except (IOError, OSError):
-                    pass
-
-            if result:
-                signum = os.WTERMSIG(result)
-                exitcode = os.WEXITSTATUS(result)
-                self.log.info('(%s) Child died from signal %s with code %s',
-                              pid, signum, exitcode)
-
-    def handle_sighup(self, *args, **kwargs):
-        ''' Pass `no_restart` to prevent restarting the run loop '''
-        self.kill_children()
-        self.spawn_children(number=self.num_processes)
-        # TODO: nothing seems to use no_restart, can it be removed?
-        if not kwargs.get('no_restart', True):
-            self.runloop()
-
-    def kill_children(self):
-        for pid, child in self.children.items():
-            try:
-                os.write(child.kill_pipe, 'k')
-                child.active = False
-                # all maintenance of children's membership happens in runloop()
-                # as children die and os.wait() gets results
-            except OSError, e:
-                if e.errno != errno.EPIPE:
-                    raise
-
-    def handle_deadlychild(self, *args, **kwargs):
-        if self.keep_going:
-            self.log.debug('A child intends to die, starting replacement before it dies')
-            self.spawn_children(number=1)
-
-    def run(self):
-        self.log.info('(%s) *** Controller starting at %s' % (self.controller_pid,
-                time.asctime()))
-
-        if self.config.get('pidfile'):
-            fd = open(self.config.get('pidfile'), 'w')
-            try:
-                fd.write('%s\n' % self.controller_pid)
-            finally:
-                fd.close()
-
-        spawning.setproctitle("spawn: controller " + self.args.get('argv_str', ''))
-
-        if self.sock is None:
-            self.sock = bind_socket(self.config)
-
-        signal.signal(signal.SIGHUP, self.handle_sighup)
-        signal.signal(signal.SIGUSR1, self.handle_deadlychild)
-
-        if self.config.get('status_port'):
-            from spawning.util import status
-            eventlet.spawn(status.Server, self,
-                self.config['status_host'], self.config['status_port'])
-
-        try:
-            self.runloop()
-        except KeyboardInterrupt:
-            self.keep_going = False
-            self.kill_children()
-        self.log.info('(%s) *** Controller exiting' % (self.controller_pid))
-
-def bind_socket(config):
-    sleeptime = 0.5
-    host = config.get('host', '')
-    port = config.get('port', 8080)
-    for x in range(8):
-        try:
-            sock = eventlet.listen((host, port))
-            break
-        except socket.error, e:
-            if e[0] != errno.EADDRINUSE:
-                raise
-            print "(%s) socket %s:%s already in use, retrying after %s seconds..." % (
-                os.getpid(), host, port, sleeptime)
-            eventlet.sleep(sleeptime)
-            sleeptime *= 2
-    else:
-        print "(%s) could not bind socket %s:%s, dying." % (
-            os.getpid(), host, port)
-        sys.exit(1)
-    return sock
-
-def set_process_owner(spec):
-    import pwd, grp
-    if ":" in spec:
-        user, group = spec.split(":", 1)
-    else:
-        user, group = spec, None
-    if group:
-        os.setgid(grp.getgrnam(group).gr_gid)
-    if user:
-        os.setuid(pwd.getpwnam(user).pw_uid)
-    return user, group
-
-def start_controller(sock, factory, factory_args):
-    c = Controller(sock, factory, factory_args)
-    installGlobal(c)
-    c.run()
-
-def main():
-    current_directory = os.path.realpath('.')
-    if current_directory not in sys.path:
-        sys.path.append(current_directory)
-
-    parser = optparse.OptionParser(description="Spawning is an easy-to-use and flexible wsgi server. It supports graceful restarting so that your site finishes serving any old requests while starting new processes to handle new requests with the new code. For the simplest usage, simply pass the dotted path to your wsgi application: 'spawn my_module.my_wsgi_app'", version=spawning.__version__)
-    parser.add_option('-v', '--verbose', dest='verbose', action='store_true', help='Display verbose configuration '
-        'information when starting up or restarting.')
-    parser.add_option("-f", "--factory", dest='factory', default='spawning.wsgi_factory.config_factory',
-        help="""Dotted path (eg mypackage.mymodule.myfunc) to a callable which takes a dictionary containing the command line arguments and figures out what needs to be done to start the wsgi application. Current valid values are: spawning.wsgi_factory.config_factory, spawning.paste_factory.config_factory, and spawning.django_factory.config_factory. The factory used determines what the required positional command line arguments will be. See the spawning.wsgi_factory module for documentation on how to write a new factory.
-        """)
-    parser.add_option("-i", "--host",
-        dest='host', default=DEFAULTS['host'],
-        help='The local ip address to bind.')
-    parser.add_option("-p", "--port",
-        dest='port', type='int', default=DEFAULTS['port'],
-        help='The local port address to bind.')
-    parser.add_option("-s", "--processes",
-        dest='processes', type='int', default=DEFAULTS['num_processes'],
-        help='The number of unix processes to start to use for handling web i/o.')
-    parser.add_option("-t", "--threads",
-        dest='threads', type='int', default=DEFAULTS['threadpool_workers'],
-        help="The number of posix threads to use for handling web requests. "
-            "If threads is 0, do not use threads but instead use eventlet's cooperative "
-            "greenlet-based microthreads, monkeypatching the socket and pipe operations which normally block "
-            "to cooperate instead. Note that most blocking database api modules will not "
-            "automatically cooperate.")
-    parser.add_option('-d', '--daemonize', dest='daemonize', action='store_true',
-        help="Daemonize after starting children.")
-    parser.add_option('-u', '--chuid', dest='chuid', metavar="ID",
-        help="Change user ID in daemon mode (and group ID if given, "
-             "separate with colon.)")
-    parser.add_option('--pidfile', dest='pidfile', metavar="FILE",
-        help="Write own process ID to FILE in daemon mode.")
-    parser.add_option('--stdout', dest='stdout', metavar="FILE",
-        help="Redirect stdout to FILE in daemon mode.")
-    parser.add_option('--stderr', dest='stderr', metavar="FILE",
-        help="Redirect stderr to FILE in daemon mode.")
-    parser.add_option('-w', '--watch', dest='watch', action='append',
-        help="Watch the given file's modification time. If the file changes, the web server will "
-            'restart gracefully, allowing old requests to complete in the old processes '
-            'while starting new processes with the latest code or configuration.')
-    ## TODO Hook up the svn reloader again
-    parser.add_option("-r", "--reload",
-        type='str', dest='reload',
-        help='If --reload=dev is passed, reload any time '
-        'a loaded module or configuration file changes.')
-    parser.add_option('-l', '--access-log-file', dest='access_log_file', default=None,
-        help='The file to log access log lines to. If not given, log to stdout. Pass /dev/null to discard logs.')
-    parser.add_option('-c', '--coverage', dest='coverage', action='store_true',
-        help='If given, gather coverage data from the running program and make the '
-            'coverage report available from the /_coverage url. See the figleaf docs '
-            'for more info: http://darcs.idyll.org/~t/projects/figleaf/doc/')
-    parser.add_option('--sysinfo', dest='sysinfo', action='store_true',
-        help='If given, gather system information data and make the '
-            'report available from the /_sysinfo url.')
-    parser.add_option('-m', '--max-memory', dest='max_memory', type='int', default=0,
-        help='If given, the maximum amount of memory this instance of Spawning '
-            'is allowed to use. If all of the processes started by this Spawning controller '
-            'use more than this amount of memory, send a SIGHUP to the controller '
-            'to get the children to restart.')
-    parser.add_option('--backdoor', dest='backdoor', action='store_true',
-            help='Start a backdoor bound to localhost:3000')
-    parser.add_option('-a', '--max-age', dest='max_age', type='int',
-        help='If given, the maximum amount of time (in seconds) an instance of spawning_child '
-            'is allowed to run. Once this time limit has expired the child will'
-            'gracefully kill itself while the server starts a replacement.')
-    parser.add_option('--no-keepalive', dest='no_keepalive', action='store_true',
-            help='Disable HTTP/1.1 KeepAlive')
-    parser.add_option('-z', '--z-restart-args', dest='restart_args',
-        help='For internal use only')
-    parser.add_option('--status-port', dest='status_port', type='int', default=0,
-        help='If given, hosts a server status page at that port.  Two pages are served: a human-readable HTML version at http://host:status_port/status, and a machine-readable version at http://host:status_port/status.json')
-    parser.add_option('--status-host', dest='status_host', type='string', default='',
-        help='If given, binds the server status page to the specified local ip address.  Defaults to the same value as --host.  If --status-port is not supplied, the status page will not be activated.')
-    parser.add_option('--ssl-certificate', dest='ssl_certificate', type='string', default='',
-        help='Absolute path to SSL certificate file.')
-    parser.add_option('--ssl-private-key', dest='ssl_private_key', type='string', default='',
-        help='Absolute path to SSL private key.')
-
-    options, positional_args = parser.parse_args()
-
-    if len(positional_args) < 1 and not options.restart_args:
-        parser.error("At least one argument is required. "
-            "For the default factory, it is the dotted path to the wsgi application "
-            "(eg my_package.my_module.my_wsgi_application). For the paste factory, it "
-            "is the ini file to load. Pass --help for detailed information about available options.")
-
-    if options.backdoor:
-        try:
-            eventlet.spawn(eventlet.backdoor.backdoor_server, eventlet.listen(('localhost', 3000)))
-        except Exception, ex:
-            sys.stderr.write('**> Error opening backdoor: %s\n' % ex)
-
-    sock = None
-
-    if options.restart_args:
-        restart_args = json.loads(options.restart_args)
-        factory = restart_args['factory']
-        factory_args = restart_args['factory_args']
-
-        start_delay = restart_args.get('start_delay')
-        if start_delay is not None:
-            factory_args['start_delay'] = start_delay
-            print "(%s) delaying startup by %s" % (os.getpid(), start_delay)
-            time.sleep(start_delay)
-
-        fd = restart_args.get('fd')
-        if fd is not None:
-            sock = socket.fromfd(restart_args['fd'], socket.AF_INET, socket.SOCK_STREAM)
-            ## socket.fromfd doesn't result in a socket object that has the same fd.
-            ## The old fd is still open however, so we close it so we don't leak.
-            os.close(restart_args['fd'])
-        return start_controller(sock, factory, factory_args)
-
-    ## We're starting up for the first time.
-    if options.daemonize:
-        # Do the daemon dance. Note that this isn't what is considered good
-        # daemonization, because frankly it's convenient to keep the file
-        # descriptiors open (especially when there are prints scattered all
-        # over the codebase.)
-        # What we do instead is fork off, create a new session, fork again.
-        # This leaves the process group in a state without a session
-        # leader.
-        pid = os.fork()
-        if not pid:
-            os.setsid()
-            pid = os.fork()
-            if pid:
-                os._exit(0)
-        else:
-            os._exit(0)
-        print "(%s) now daemonized" % (os.getpid(),)
-        # Close _all_ open (and othewise!) files.
-        import resource
-        maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
-        if maxfd == resource.RLIM_INFINITY:
-            maxfd = 4096
-        for fdnum in xrange(maxfd):
-            try:
-                os.close(fdnum)
-            except OSError, e:
-                if e.errno != errno.EBADF:
-                    raise
-        # Remap std{in,out,err}
-        devnull = os.open(os.path.devnull, os.O_RDWR)
-        oflags = os.O_WRONLY | os.O_CREAT | os.O_APPEND
-        if devnull != 0:  # stdin
-            os.dup2(devnull, 0)
-        if options.stdout:
-            stdout_fd = os.open(options.stdout, oflags)
-            if stdout_fd != 1:
-                os.dup2(stdout_fd, 1)
-                os.close(stdout_fd)
-        else:
-            os.dup2(devnull, 1)
-        if options.stderr:
-            stderr_fd = os.open(options.stderr, oflags)
-            if stderr_fd != 2:
-                os.dup2(stderr_fd, 2)
-                os.close(stderr_fd)
-        else:
-            os.dup2(devnull, 2)
-        # Change user & group ID.
-        if options.chuid:
-            user, group = set_process_owner(options.chuid)
-            print "(%s) set user=%s group=%s" % (os.getpid(), user, group)
-    else:
-        # Become a process group leader only if not daemonizing.
-        os.setpgrp()
-
-    ## Fork off the thing that watches memory for this process group.
-    controller_pid = os.getpid()
-    if options.max_memory and not os.fork():
-        env = environ()
-        from spawning import memory_watcher
-        basedir, cmdname = os.path.split(memory_watcher.__file__)
-        if cmdname.endswith('.pyc'):
-            cmdname = cmdname[:-1]
-
-        os.chdir(basedir)
-        command = [
-            sys.executable,
-            cmdname,
-            '--max-age', str(options.max_age),
-            str(controller_pid),
-            str(options.max_memory)]
-        os.execve(sys.executable, command, env)
-
-    factory = options.factory
-
-    # If you tell me to watch something, I'm going to reload then
-    if options.watch:
-        options.reload = True
-
-    if options.status_port == options.port:
-        options.status_port = None
-        sys.stderr.write('**> Status port cannot be the same as the service port, disabling status.\n')
-
-
-    factory_args = {
-        'verbose': options.verbose,
-        'host': options.host,
-        'port': options.port,
-        'num_processes': options.processes,
-        'threadpool_workers': options.threads,
-        'watch': options.watch,
-        'reload': options.reload,
-        'access_log_file': options.access_log_file,
-        'pidfile': options.pidfile,
-        'coverage': options.coverage,
-        'sysinfo': options.sysinfo,
-        'no_keepalive' : options.no_keepalive,
-        'max_age' : options.max_age,
-        'argv_str': " ".join(sys.argv[1:]),
-        'args': positional_args,
-        'status_port': options.status_port,
-        'status_host': options.status_host or options.host,
-	'ssl_private_key': options.ssl_private_key,
-	'ssl_certificate': options.ssl_certificate
-    }
-    start_controller(sock, factory, factory_args)
-
-_global_attr_name_ = '_spawning_controller_'
-def installGlobal(controller):
-    setattr(sys, _global_attr_name_, controller)
-
-def globalController():
-    return getattr(sys, _global_attr_name_, None)
-
-
-if __name__ == '__main__':
-    main()
-
-
-

+ 0 - 55
desktop/core/ext-py/Spawning-0.9.6/src/spawning/util/__init__.py

@@ -1,55 +0,0 @@
-# Copyright (c) 2010, R. Tyler Ballance
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-def named(name):
-    """Return an object given its name.
-
-    The name uses a module-like syntax, eg::
-
-      os.path.join
-
-    or::
-
-      mulib.mu.Resource
-    """
-    toimport = name
-    obj = None
-    import_err_strings = []
-    while toimport:
-        try:
-            obj = __import__(toimport)
-            break
-        except ImportError, err:
-            # print 'Import error on %s: %s' % (toimport, err)  # debugging spam
-            import_err_strings.append(err.__str__())
-            toimport = '.'.join(toimport.split('.')[:-1])
-    if obj is None:
-        raise ImportError('%s could not be imported.  Import errors: %r' % (name, import_err_strings))
-    for seg in name.split('.')[1:]:
-        try:
-            obj = getattr(obj, seg)
-        except AttributeError:
-            dirobj = dir(obj)
-            dirobj.sort()
-            raise AttributeError('attribute %r missing from %r (%r) %r.  Import errors: %r' % (
-                seg, obj, dirobj, name, import_err_strings))
-    return obj

+ 0 - 171
desktop/core/ext-py/Spawning-0.9.6/src/spawning/util/log_parser.py

@@ -1,171 +0,0 @@
-import time
-from datetime import datetime, timedelta
-import sys
-import optparse
-import re
-
-__all__ = ['parse_line', 'parse_lines', 'parse_casual_time',
-    'group_parsed_lines', 'select_timerange']
-
-month_names = {'Jan': 1, 'Feb': 2, 'Mar':3, 'Apr':4, 'May':5, 'Jun':6, 'Jul':7, 
-    'Aug':8,  'Sep': 9, 'Oct':10, 'Nov': 11, 'Dec': 12}
-
-
-def parse_line(line):
-    """ Parses a Spawning log line into a dictionary of fields.
-    
-    Returns the following fields: 
-    * client_ip : The remote IP address.
-    * date : datetime object representing when the request completed
-    * method : HTTP method
-    * path : url path
-    * version : HTTP version
-    * status_code : HTTP status code
-    * size : length of the body
-    * duration : time in seconds to complete the request
-    """
-    # note that a split-based version of the function is faster than
-    # a regexp-based version
-    segs = line.split()
-    if len(segs) != 11:
-        return None
-    retval = {}
-    try:
-        retval['client_ip'] = segs[0]
-        if segs[1] != '-' or segs[2] != '-':
-            return None
-        if segs[3][0] != '[' or segs[4][-1] != ']':
-            return None
-        # time parsing by explicitly poking at string slices is much faster 
-        # than strptime, but it won't work in non-English locales because of 
-        # the month names
-        d = segs[3]
-        t = segs[4]
-        retval['date'] = datetime(
-            int(d[8:12]),         # year
-            month_names[d[4:7]],  # month
-            int(d[1:3]),          # day
-            int(t[0:2]),          # hour
-            int(t[3:5]),          # minute
-            int(t[6:8]))          # second
-        if segs[5][0] != '"' or segs[7][-1] != '"':
-            return None
-        retval['method'] = segs[5][1:]
-        retval['path'] = segs[6]
-        retval['version'] = segs[7][:-1]
-        retval['status_code'] = int(segs[8])
-        retval['size'] = int(segs[9])
-        retval['duration'] = float(segs[10])
-    except (IndexError, ValueError):
-        return None
-    return retval
-    
-    
-def parse_lines(fd):
-    """Generator function that accepts an iterable file-like object and 
-    yields all the parseable lines found in it.
-    """
-    for line in fd:
-        parsed = parse_line(line)
-        if parsed is not None:
-            yield parsed
-
-
-time_intervals = {"sec":1, "min":60, "hr":3600, "day": 86400,
-                  "second":1, "minute":60, "hour":3600,
-                  "s":1, "m":60, "h":3600, "d":86400}
-for k,v in time_intervals.items():  # pluralize
-    time_intervals[k + "s"] = v
-    
-    
-def parse_casual_time(timestr, relative_to):
-    """Lenient relative time parser.  Returns a datetime object if it can.
-    
-    Accepts such human-friendly times as "-1 hour", "-30s", "15min", "2d", "now".
-    Any such relative time is interpreted as a delta applied to the relative_to
-    argument, which should be a datetime.
-    """
-    timestr = timestr.lower()
-    try:
-        return datetime(*(time.strptime(timestr)[0:6]))
-    except ValueError:
-        pass
-    if timestr == "now":
-        return datetime.now()
-    # match stuff like "-1 hour", "-30s"
-    m = re.match(r'([-0-9.]+)\s*(\w+)?', timestr)
-    if m:
-        intervalsz = 1
-        if len(m.groups()) > 1 and m.group(2) in time_intervals:
-            intervalsz = time_intervals[m.group(2)]
-        relseconds = float(m.group(1)) * intervalsz
-        return relative_to + timedelta(seconds=relseconds)
-
-def group_parsed_lines(lines, field):
-    """Aggregates the parsed log lines by a field.  Counts
-    the log lines in each group and their average duration.  The return
-    value is a dict, where the keys are the unique field values, and the values
-    are dicts of count, avg_duration, and the key.
-    """
-    grouped = {}
-    for parsed in lines:
-        key = parsed[field]
-        summary = grouped.setdefault(key, {'count':0, 'total_duration':0.0})
-        summary[field] = key
-        summary['count'] += 1
-        summary['total_duration'] += parsed['duration']
-    # average dat up
-    for summary in grouped.values():
-        summary['avg_duration'] = summary['total_duration']/summary['count']
-        del summary['total_duration']
-    return grouped
-
-def select_timerange(lines, earliest=None, latest=None):
-    """ Generator that accepts an iterable of parsed log lines and yields
-    the log lines that are between the earliest and latest dates.  If
-    either earliest or latest is None, it is ignored."""
-    for parsed in lines:
-        if earliest and parsed['date'] < earliest:
-            continue
-        if latest and parsed['date'] > latest:
-            continue
-        yield parsed
-
-
-if __name__ == "__main__":
-    parser = optparse.OptionParser()
-    parser.add_option('--earliest', dest='earliest', default=None,
-        help='Earliest date to count, either as a full date or a relative time \
-such as "-1 hour".  Relative to --latest, so you generally want to\
-specify a negative relative.')
-    parser.add_option('--latest', dest='latest', default=None,
-        help='Latest date to count, either as a full date or a relative time\
-such as "-30s".  Relative to now.')
-    parser.add_option('--group-by', dest='group_by', default='path',
-        help='Compute counts and aggregates for log lines grouped by this\
-attribute.  Good values include "status_code", "method", and\
-"path" (the default).')
-    opts, args = parser.parse_args()
-
-    if opts.latest:
-        opts.latest = parse_casual_time(opts.latest, datetime.now())
-    if opts.earliest:
-        opts.earliest = parse_casual_time(opts.earliest, 
-                                            opts.latest or datetime.now())
-    if opts.earliest or opts.latest:
-        print "Including dates between", \
-            opts.earliest or "the beginning of time", "and", opts.latest or "now"
-    
-    parsed_lines = parse_lines(sys.stdin)
-    grouped = group_parsed_lines(
-        select_timerange(parsed_lines, opts.earliest, opts.latest),
-        opts.group_by)
-    
-    flat = grouped.values()
-    flat.sort(key=lambda x: x['count'])
-    flat.reverse()
-    print "Count\tAvg Dur\t%s" % opts.group_by
-    for summary in flat:
-        print "%d\t%.4f\t%s" % (summary['count'], 
-            summary['avg_duration'], summary[opts.group_by])
-

+ 0 - 366
desktop/core/ext-py/Spawning-0.9.6/src/spawning/util/status.py

@@ -1,366 +0,0 @@
-import datetime
-try:
-    import json
-except ImportError:
-    import simplejson as json
-
-import eventlet
-from eventlet import event
-from eventlet import wsgi
-from eventlet.green import os
-
-class Server(object):
-    def __init__(self, controller, host, port):
-        self.controller = controller
-        self.host = host
-        self.port = port
-        self.status_waiter = None
-        self.child_events = {}
-        socket = eventlet.listen((host, port))
-        wsgi.server(socket, self.application)
-
-    def get_status_data(self):
-        # using a waiter because we only want one child collection ping
-        # happening at a time; if there are multiple concurrent status requests,
-        # they all simply share the same set of data results
-        if self.status_waiter is None:
-            self.status_waiter = eventlet.spawn(self._collect_status_data)
-        return self.status_waiter.wait()
-    
-    def _collect_status_data(self):
-        try:
-            now = datetime.datetime.now()
-            children = self.controller.children.values()
-            status_data = {
-                'active_children_count':len([c 
-                    for c in children
-                    if c.active]),
-                'killed_children_count':len([c 
-                    for c in children
-                    if not c.active]),
-                'configured_children_count':self.controller.num_processes,
-                'now':now.ctime(),
-                'pid':os.getpid(),
-                'uptime':format_timedelta(now - self.controller.started_at),
-                'started_at':self.controller.started_at.ctime(),
-                'config':self.controller.config}
-            # fire up a few greenthreads to wait on children's responses
-            p = eventlet.GreenPile()
-            for child in self.controller.children.values():
-                p.spawn(self.collect_child_status, child)
-            status_data['children'] = dict([pid_cd for pid_cd in p])
-            
-            # total concurrent connections
-            status_data['concurrent_requests'] = sum([
-                child.get('concurrent_requests', 0)
-                for child in status_data['children'].values()])
-        finally:
-            # wipe out the waiter so that subsequent requests create new ones
-            self.status_waiter = None
-        return status_data
-
-    def collect_child_status(self, child):
-        self.child_events[child.pid] = event.Event()
-        try:
-            try:
-                # tell the child to POST its status to us, we handle it in the
-                # wsgi application below
-                eventlet.hubs.trampoline(child.kill_pipe, write=True)
-                os.write(child.kill_pipe, 's')
-                t = eventlet.Timeout(1)
-                results = self.child_events[child.pid].wait()
-                t.cancel()
-            except (OSError, IOError), e:
-                results = {'error': "%s %s" % (type(e), e)}
-            except eventlet.Timeout:
-                results = {'error':'Timed out'}
-        finally:
-            self.child_events.pop(child.pid, None)
-            
-        results.update({
-            'pid':child.pid, 
-            'active':child.active,
-            'uptime':format_timedelta(datetime.datetime.now() - child.forked_at),
-            'forked_at':child.forked_at.ctime()})
-        return child.pid, results
-
-    def application(self, environ, start_response):
-        if environ['REQUEST_METHOD'] == 'GET':
-            status_data = self.get_status_data()
-            if environ['PATH_INFO'] == '/status':
-                start_response('200 OK', [('content-type', 'text/html')])
-                return [fill_template(status_data)]
-            elif environ['PATH_INFO'] == '/status.json':
-                start_response('200 OK', [('content-type', 'application/json')])
-                return [json.dumps(status_data, indent=2)]
-                
-        elif environ['REQUEST_METHOD'] == 'POST':
-            # it's a client posting its stats to us
-            body = environ['wsgi.input'].read()
-            child_status = json.loads(body)
-            pid = child_status['pid']
-            if pid in self.child_events:
-                self.child_events[pid].send(child_status)
-                start_response('200 OK', [('content-type', 'application/json')])
-            else:
-                start_response('500 Internal Server Error', 
-                               [('content-type', 'text/plain')])
-                print "Don't know about child pid %s" % pid
-            return [""]
-        
-        # fallthrough case
-        start_response('404 Not Found', [('content-type', 'text/plain')])
-        return [""]
-
-def format_timedelta(t):
-    """Based on how HAProxy's status page shows dates.
-    10d 14h
-    3h 20m
-    1h 0m
-    12m
-    15s
-    """
-    seconds = t.seconds
-    if t.days > 0:
-        return "%sd %sh" % (t.days, int(seconds/3600))
-    else:
-        if seconds > 3600:
-            hours = int(seconds/3600)
-            seconds -= hours*3600
-            return "%sh %sm" % (hours, int(seconds/60))
-        else:
-            if seconds > 60:
-                return "%sm" % int(seconds/60)
-            else:
-                return "%ss" % seconds
-
-class Tag(object):
-    """Yeah, there's a templating DSL in this status module.  Deal with it."""
-    def __init__(self, name, *children, **attrs):
-        self.name = name
-        self.attrs = attrs
-        self.children = list(children)
-
-    def __str__(self):
-        al = []
-        for name, val in self.attrs.iteritems():
-            if name == 'cls':
-                name = "class"
-            if isinstance(val, (list, tuple)):
-                val = " ".join(val)
-            else:
-                val = str(val)
-            al.append('%s="%s"' % (name, val))
-        if al:
-            attrstr = " " + " ".join(al) + " "
-        else:
-            attrstr = ""
-        cl = []
-        for child in self.children:
-            cl.append(str(child))
-        if cl:
-            childstr = "\n" + "\n".join(cl) + "\n"
-        else:
-            childstr = ""
-        return "<%s%s>%s</%s>" % (self.name, attrstr, childstr, self.name)
-
-def make_tag(name):
-    return lambda *c, **a: Tag(name, *c, **a)
-p = make_tag('p')
-div = make_tag('div')
-table = make_tag('table')
-tr = make_tag('tr')
-th = make_tag('th')
-td = make_tag('td')
-h2 = make_tag('h2')
-span = make_tag('span')
-
-def fill_template(status_data):
-    # controller status
-    cont_div = table(id='controller')
-    cont_div.children.append(tr(th("PID:", title="Controller Process ID"), 
-        td(status_data['pid'])))
-    cont_div.children.append(tr(th("Uptime:", title="Time since launch"), 
-        td(status_data['uptime'])))
-    cont_div.children.append(tr(th("Host:", title="Host and port server is listening on, all means all interfaces."), 
-        td("%s:%s" % (status_data['config']['host'] or "all",
-            status_data['config']['port']))))
-    cont_div.children.append(tr(th("Threads:", title="Threads per child"), 
-        td(status_data['config']['threadpool_workers'])))
-    cont_div = div(cont_div)
-    
-    # children headers and summaries
-    child_div = div(h2("Child Processes"))
-    count_td = td(status_data['active_children_count'], "/", 
-                  status_data['configured_children_count'])
-    if status_data['active_children_count'] < \
-       status_data['configured_children_count']:
-        count_td.attrs['cls'] = "error"
-        count_td.children.append(
-            span("(", status_data['killed_children_count'], ")"))
-    children_table = table(
-      tr(
-        th('PID', title="Process ID"), 
-        th('Active', title="Accepting New Requests"), 
-        th('Uptime', title="Uptime"), 
-        th('Concurrent', title="Concurrent Requests")),
-      tr(
-        td("Total"),
-        count_td,
-        td(),  # no way to "total" uptime
-        td(status_data['concurrent_requests'])),
-      id="children")
-    child_div.children.append(children_table)
-    
-    # children themselves
-    odd = True
-    for pid in sorted(status_data['children'].keys()):
-        child = status_data['children'][pid]
-        row = tr(td(pid), cls=['child'])
-        if odd:
-            row.attrs['cls'].append('odd')
-        odd = not odd
-        
-        # active handling
-        row.children.append(td({True:'Y', False:'N'}[child['active']]))
-        if not child['active']:
-            row.attrs['cls'].append('dying')
-            
-        # errors
-        if child.get('error'):
-            row.attrs['cls'].append('error')
-            row.children.append(td(child['error'], colspan=2))
-        else:
-            # no errors
-            row.children.append(td(child['uptime']))
-            row.children.append(td(child['concurrent_requests']))
-            
-        children_table.children.append(row)
-        
-    # config dump
-    config_div = div(
-        h2("Configuration"),
-        table(*[tr(th(key),  td(status_data['config'][key]))
-            for key in sorted(status_data['config'].keys())]), 
-        id='config')
-        
-    to_format = {'cont_div': cont_div, 'child_div':child_div,
-                 'config_div':config_div}
-    to_format.update(status_data)
-    return HTML_SHELL % to_format
-
-HTML_SHELL = """
-<!DOCTYPE html>
-<html><head>
-<title>Spawning Status</title>
-<style type="text/css">
-html, p, div, table, h1, h2, input, form {
-	margin: 0;
-	padding: 0;
-	border: 0;
-	outline: 0;
-	font-size: 12px;
-	font-family: Helvetica, Arial, sans-serif;
-	vertical-align: baseline;
-}
-body {
-	line-height: 1.2;
-	color: black;
-	background: white;
-	margin: 3em;
-}
-table {
-	border-collapse: separate;
-	border-spacing: 0;
-}
-th, td {
-	text-align: center;
-	padding: .1em;
-    padding-right: .4em;
-}
-#controller td, #controller th {
-    text-align: left;
-}
-#config td, #config th {
-    text-align: left;
-}
-#children {
-    clear: both;
-}
-#options {
-    float: right;
-    border: 1px solid #dfdfdf;
-    padding:.5em;
-}
-h1,h2 {
-    margin: .5em;
-    margin-left: 0em;
-    font-size: 130%%;  
-}
-h2 {
-    font-size: 115%%;  
-}
-tr.odd {
-    background: #dfdfdf;
-}
-input {
-    border: 1px solid grey;
-}
-#refresh form {
-    display: inline;
-}
-tr.child.dying {
-    font-style: italic;
-    color: #444444;
-}
-.error {
-    background: #ff4444;
-}
-
-/* Cut out the fat for mobile devices */
-@media screen and (max-width: 400px) {
-    body {
-        margin-left: .2em;
-        margin-right: .2em;
-    }
-    #options {
-        float: none;
-    }
-}
-</style>
-</head><body>
-<h1>Spawning Status</h1>
-<div id="options">
-<p>%(now)s</p>
-<div id="refresh">
-<a href="">Refresh</a> (<form>
-  <input type="checkbox" /> every
-  <input type="text" value="5" size=2 />s
-</form>)
-</div>
-<a href="status.json">JSON</a>
-</div>
-%(cont_div)s
-%(child_div)s
-%(config_div)s
-<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
-<script type="text/javascript">
-$(document).ready(function() {
-    var timer;
-    var arrangeTimeout = function () {
-        clearTimeout(timer);
-        if($('#refresh input[type=checkbox]').attr('checked')) {
-            timer = setTimeout(
-                function() {window.location.reload();},
-                $('#refresh input[type=text]').val() * 1000);
-        }
-        if($(this).is('form')) {
-            return false;
-        }
-    };
-    $('#refresh input[type=checkbox]').click(arrangeTimeout);
-    $('#refresh form').submit(arrangeTimeout).submit();
-});
-</script>
-</body></html>
-"""

+ 0 - 96
desktop/core/ext-py/Spawning-0.9.6/src/spawning/util/system.py

@@ -1,96 +0,0 @@
-# Copyright (c) 2010, Steve 'Ashcrow' MIlner
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-"""
-Platform related items.
-"""
-
-import os
-import platform
-import sys
-import tempfile
-
-
-class System(dict):
-    """
-    Class to make finding out system information all in one place.
-
-    **Note**: You can not add attributes to an instance of this class.
-    """
-
-    def __init__(self):
-        dict.__init__(self, {
-            'architecture': platform.architecture(),
-            'max_int': sys.maxint,
-            'max_size': sys.maxsize,
-            'max_unicode': sys.maxunicode,
-            'name': platform.node(),
-            'path_seperator': os.path.sep,
-            'processor': platform.processor(),
-            'python_version': platform.python_version(),
-            'python_branch': platform.python_branch(),
-            'python_build': platform.python_build(),
-            'python_compiler': platform.python_compiler(),
-            'python_implementation': platform.python_implementation(),
-            'python_revision': platform.python_revision(),
-            'python_version_tuple': platform.python_version_tuple(),
-            'python_path': sys.path,
-            'login': os.getlogin(),
-            'system': platform.system(),
-            'temp_directory': tempfile.gettempdir(),
-            'uname': platform.uname(),
-    })
-
-    def __getattr__(self, name):
-        """
-        Looks in the dictionary for items **only**.
-
-        :Parameters:
-           - 'name': name of the attribute to get.
-        """
-        data = dict(self).get(name)
-        if data == None:
-            raise AttributeError("'%s' has no attribute '%s'" % (
-                self.__class__.__name__, name))
-        return data
-
-    def __setattr__(self, key, value):
-        """
-        Setting attributes is **not** allowed.
-
-        :Parameters:
-           - `key`: attribute name to set.
-           - `value`: value to set attribute to.
-        """
-        raise AttributeError("can't set attribute")
-
-    def __repr__(self):
-        """
-        Nice object representation.
-        """
-        return unicode(
-            "<Platform: system='%s', name='%s', arch=%s, processor='%s'>" % (
-            self.system, self.name, self.architecture, self.processor))
-
-    # Method aliases
-    __str__ = __repr__
-    __unicode__ = __repr__
-    __setitem__ = __setattr__

+ 0 - 82
desktop/core/ext-py/Spawning-0.9.6/src/spawning/wsgi_factory.py

@@ -1,82 +0,0 @@
-# Copyright (c) 2008, Donovan Preston
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-"""The config_factory takes a dictionary containing the command line arguments
-and should return the same dictionary after modifying any of the settings it wishes.
-At the very least the config_factory must set the 'app_factory' key in the returned
-argument dictionary, which should be the dotted path to the function which will be
-called to actually return the wsgi application which will be served.  Also, the
-config_factory can look at the 'args' key for any additional positional command-line
-arguments that were passed to spawn, and modify the configuration dictionary
-based on it's contents.
-
-Return value of config_factory should be a dict containing:
-    app_factory: The dotted path to the wsgi application factory.
-        Will be called with the result of factory_qual as the argument.
-    host: The local ip to bind to.
-    port: The local port to bind to.
-    num_processes: The number of processes to spawn.
-    num_threads: The number of threads to use in the threadpool in each process.
-        If 0, install the eventlet monkeypatching and do not use the threadpool.
-        Code which blocks instead of cooperating will block the process, possibly
-        causing stalls. (TODO sigalrm?)
-    dev: If True, watch all files in sys.modules, easy-install.pth, and any additional
-        file paths in the 'watch' list for changes and restart child
-        processes on change. If False, only reload if the svn revision of the
-        current directory changes.
-    watch: List of additional files to watch for changes and reload when changed.
-"""
-import inspect
-import os
-import time
-
-import spawning.util
-
-def config_factory(args):
-    args['app_factory'] = 'spawning.wsgi_factory.app_factory'
-    args['app'] = args['args'][0]
-    args['middleware'] = args['args'][1:]
-
-    args['source_directories'] = [os.path.split(
-        inspect.getfile(
-            inspect.getmodule(
-                spawning.util.named(args['app']))))[0]]
-    return args
-
-
-def app_factory(config):
-    app = spawning.util.named(config['app'])
-    for mid in config['middleware']:
-        app = spawning.util.named(mid)(app)
-    return app
-
-
-def hello_world(env, start_response):
-    start_response('200 OK', [('Content-type', 'text/plain')])
-    return ['Hello, World!\r\n']
-
-
-def really_long(env, start_response):
-    start_response('200 OK', [('Content-type', 'text/plain')])
-    time.sleep(180)
-    return ['Goodbye, World!\r\n']
-

+ 0 - 202
desktop/core/ext-py/django-moxy/LICENSE.txt

@@ -1,202 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.

+ 0 - 7
desktop/core/ext-py/django-moxy/README

@@ -1,7 +0,0 @@
-django-moxy
-============
-
-This version of Moxy is maintained separately from the original branch.
-The original author is R. Tyler Croy.
-
-See https://github.com/rtyler/django-moxy for more information.

+ 0 - 26
desktop/core/ext-py/django-moxy/README.markdown

@@ -1,26 +0,0 @@
-django-moxy
-============
-
-
-### What it is
-
-"Moxy" is a Django database backend for MySQL. Built on top of MySQLdb [0]
-and Eventlet [1], it uses eventlet.db_pool to provide a greenthread-safe 
-means of accessing MySQL via MySQLdb's blocking calls.
-
-
-### Why Moxy?
-
-Another member of the `#eventlet` channel on Freenode was soliciting for names
-of a reverse proxying HTTP server he wrote built off of Eventlet. I suggested
-the name "Moxy" which was well received until everybody started listing examples
-of other projects named "Moxy".
-
-Since then it's become a kind of lame inside joke to suggest "Moxy" as the name for
-any new project.
-
-
-
-
-[0] http://sourceforge.net/projects/mysql-python/
-[1] http://eventlet.net

+ 0 - 3
desktop/core/ext-py/django-moxy/moxy/__init__.py

@@ -1,3 +0,0 @@
-#!/usr/bin/env python
-
-__version__ = '1.0.0'

+ 0 - 150
desktop/core/ext-py/django-moxy/moxy/base.py

@@ -1,150 +0,0 @@
-#!/usr/bin/env python
-'''
-    MySQL database backend for Django using MySQLdb and Eventlet
-'''
-
-import eventlet.db_pool
-
-from django.db.backends import BaseDatabaseWrapper, BaseDatabaseFeatures, BaseDatabaseOperations, util
-try:
-    import MySQLdb
-except ImportError, e:
-    from django.core.exceptions import ImproperlyConfigured
-    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
-
-import re
-
-from MySQLdb.converters import conversions
-from MySQLdb.constants import FIELD_TYPE, FLAG, CLIENT
-
-from django.db.backends import *
-from django.db.backends.mysql import base as mysqldb_base
-from django.db.backends.mysql.client import DatabaseClient
-from django.db.backends.mysql.creation import DatabaseCreation
-from django.db.backends.mysql.introspection import DatabaseIntrospection
-from django.db.backends.mysql.validation import DatabaseValidation
-from django.db.backends.signals import connection_created
-from django.utils.safestring import SafeString, SafeUnicode
-
-# Raise exceptions for database warnings if DEBUG is on
-from django.conf import settings
-
-DatabaseError = MySQLdb.DatabaseError
-IntegrityError = MySQLdb.IntegrityError
-
-# MySQLdb-1.2.1 returns TIME columns as timedelta -- they are more like
-# timedelta in terms of actual behavior as they are signed and include days --
-# and Django expects time, so we still need to override that. We also need to
-# add special handling for SafeUnicode and SafeString as MySQLdb's type
-# checking is too tight to catch those (see Django ticket #6052).
-django_conversions = conversions.copy()
-django_conversions.update({
-    FIELD_TYPE.TIME: util.typecast_time,
-    FIELD_TYPE.DECIMAL: util.typecast_decimal,
-    FIELD_TYPE.NEWDECIMAL: util.typecast_decimal,
-})
-
-# This should match the numerical portion of the version numbers (we can treat
-# versions like 5.0.24 and 5.0.24a as the same). Based on the list of version
-# at http://dev.mysql.com/doc/refman/4.1/en/news.html and
-# http://dev.mysql.com/doc/refman/5.0/en/news.html .
-server_version_re = re.compile(r'(\d{1,2})\.(\d{1,2})\.(\d{1,2})')
-
-# MySQLdb-1.2.1 and newer automatically makes use of SHOW WARNINGS on
-# MySQL-4.1 and newer, so the MysqlDebugWrapper is unnecessary. Since the
-# point is to raise Warnings as exceptions, this can be done with the Python
-# warning module, and this is setup when the connection is created, and the
-# standard util.CursorDebugWrapper can be used. Also, using sql_mode
-# TRADITIONAL will automatically cause most warnings to be treated as errors.
-
-class DatabaseFeatures(mysqldb_base.DatabaseFeatures):
-    pass
-
-
-class DatabaseWrapper(BaseDatabaseWrapper):
-
-    operators = {
-        'exact': '= %s',
-        'iexact': 'LIKE %s',
-        'contains': 'LIKE BINARY %s',
-        'icontains': 'LIKE %s',
-        'regex': 'REGEXP BINARY %s',
-        'iregex': 'REGEXP %s',
-        'gt': '> %s',
-        'gte': '>= %s',
-        'lt': '< %s',
-        'lte': '<= %s',
-        'startswith': 'LIKE BINARY %s',
-        'endswith': 'LIKE BINARY %s',
-        'istartswith': 'LIKE %s',
-        'iendswith': 'LIKE %s',
-    }
-
-    def __init__(self, *args, **kwargs):
-        super(DatabaseWrapper, self).__init__(*args, **kwargs)
-        self.server_version = None
-
-        self.features = DatabaseFeatures()
-        self.ops = mysqldb_base.DatabaseOperations()
-        self.client = DatabaseClient(self)
-        self.creation = DatabaseCreation(self)
-        self.introspection = DatabaseIntrospection(self)
-        self.validation = DatabaseValidation(self)
-
-        self.pool = None
-
-    def _valid_connection(self):
-        if self.connection is not None:
-            try:
-                self.connection.ping()
-                return True
-            except DatabaseError:
-                self.put(self.connection)
-                self.connection = None
-        return False
-
-    def _cursor(self):
-        if not self.pool:
-            kwargs = {
-                'conv': django_conversions,
-                'charset': 'utf8',
-                'use_unicode': True,
-            }
-            settings_dict = self.settings_dict
-            if settings_dict['USER']:
-                kwargs['user'] = settings_dict['USER']
-            if settings_dict['NAME']:
-                kwargs['db'] = settings_dict['NAME']
-            if settings_dict['PASSWORD']:
-                kwargs['passwd'] = settings_dict['PASSWORD']
-            if settings_dict['HOST'].startswith('/'):
-                kwargs['unix_socket'] = settings_dict['HOST']
-            elif settings_dict['HOST']:
-                kwargs['host'] = settings_dict['HOST']
-            if settings_dict['PORT']:
-                kwargs['port'] = int(settings_dict['PORT'])
-            kwargs['client_flag'] = CLIENT.FOUND_ROWS
-            kwargs.update(settings_dict['OPTIONS'])
-            self.pool = eventlet.db_pool.TpooledConnectionPool(MySQLdb, min_size=1, max_size=16, **kwargs)
-
-        if not self._valid_connection():
-            self.connection = self.pool.get()
-            connection_created.send(sender=self.__class__)
-        cursor = mysqldb_base.CursorWrapper(self.connection.cursor())
-        return cursor
-
-    def _rollback(self):
-        try:
-            BaseDatabaseWrapper._rollback(self)
-        except Database.NotSupportedError:
-            pass
-
-    def get_server_version(self):
-        if not self.server_version:
-            if not self._valid_connection():
-                self.cursor()
-            m = server_version_re.match(self.connection._base.get_server_info())
-            if not m:
-                raise Exception('Unable to determine MySQL version from version string %r' % self.connection.get_server_info())
-            self.server_version = tuple([int(x) for x in m.groups()])
-        return self.server_version

+ 0 - 8
desktop/core/ext-py/django-moxy/moxy/tests.py

@@ -1,8 +0,0 @@
-#!/usr/bin/env python
-
-import unittest
-
-
-if __name__ == '__main__':
-    unittest.main()
-

+ 0 - 22
desktop/core/ext-py/django-moxy/setup.py

@@ -1,22 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-from setuptools import find_packages, setup
-
-from moxy import __version__
-
-requirements = [
-        'eventlet >= 0.9.3',
-    ]
-    
-setup(
-    name='moxy',
-    version=__version__,
-    description='''Django db backend for MySQL using MySQLdb and eventlet.db_pool''',
-    author='R. Tyler Ballance',
-    author_email='tyler@linux.com',
-    url='http://github.com/rtyler/django-moxy',
-    packages=['moxy'],
-    install_requires=requirements,
-    test_suite='moxy.tests',
-)

+ 0 - 71
desktop/core/ext-py/eventlet-0.9.14/AUTHORS

@@ -1,71 +0,0 @@
-Maintainer (i.e., Who To Hassle If You Find Bugs)
--------------------------------------------------
-Ryan Williams, rdw on Freenode, breath@alum.mit.edu
-
-Original Authors
-----------------
-* Bob Ippolito
-* Donovan Preston
-
-Contributors
-------------
-* AG Projects
-* Chris AtLee
-* R\. Tyler Ballance
-* Denis Bilenko
-* Mike Barton
-* Patrick Carlisle
-* Ben Ford
-* Andrew Godwin
-* Brantley Harris
-* Gregory Holt
-* Joe Malicki
-* Chet Murthy
-* Eugene Oden
-* radix
-* Scott Robinson
-* Tavis Rudd
-* Sergey Shepelev
-* Chuck Thier
-* Nick V
-* Daniele Varrazzo
-* Ryan Williams
-
-Linden Lab Contributors
------------------------
-* John Beisley
-* Tess Chu
-* Nat Goodspeed
-* Dave Kaprielian
-* Kartic Krishnamurthy
-* Bryan O'Sullivan
-* Kent Quirk
-* Ryan Williams
-
-Thanks To
----------
-* AdamKG, giving the hint that invalid argument errors were introduced post-0.9.0
-* Luke Tucker, bug report regarding wsgi + webob
-* Taso Du Val, reproing an exception squelching bug, saving children's lives  ;-)
-* Luci Stanescu, for reporting twisted hub bug
-* Marcus Cavanaugh, for test case code that has been incredibly useful in tracking down bugs
-* Brian Brunswick, for many helpful questions and suggestions on the mailing list
-* Cesar Alaniz, for uncovering bugs of great import
-* the grugq, for contributing patches, suggestions, and use cases
-* Ralf Schmitt, for wsgi/webob incompatibility bug report and suggested fix
-* Benoit Chesneau, bug report on green.os and patch to fix it
-* Slant, better iterator implementation in tpool
-* Ambroff, nice pygtk hub example
-* Michael Carter, websocket patch to improve location handling
-* Marcin Bachry, nice repro of a bug and good diagnosis leading to the fix
-* David Ziegler, reporting issue #53
-* Favo Yang, twisted hub patch
-* Schmir, patch that fixes readline method with chunked encoding in wsgi.py, advice on patcher
-* Slide, for open-sourcing gogreen
-* Holger Krekel, websocket example small fix
-* mikepk, debugging MySQLdb/tpool issues
-* Malcolm Cleaton, patch for Event exception handling
-* Alexey Borzenkov, for finding and fixing issues with Windows error detection (#66, #69), reducing dependencies in zeromq hub (#71)
-* Anonymous, finding and fixing error in websocket chat example (#70)
-* Edward George, finding and fixing an issue in the [e]poll hubs (#74)
-* Ruijun Luo, figuring out incorrect openssl import for wrap_ssl (#73)

+ 0 - 23
desktop/core/ext-py/eventlet-0.9.14/LICENSE

@@ -1,23 +0,0 @@
-Unless otherwise noted, the files in Eventlet are under the following MIT license:
-
-Copyright (c) 2005-2006, Bob Ippolito
-Copyright (c) 2007-2010, Linden Research, Inc.
-Copyright (c) 2008-2010, Eventlet Contributors (see AUTHORS)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.

+ 0 - 4
desktop/core/ext-py/eventlet-0.9.14/MANIFEST.in

@@ -1,4 +0,0 @@
-recursive-include tests *.py *.crt *.key
-recursive-include doc *.rst *.txt *.py Makefile *.png
-recursive-include examples *.py *.html
-include MANIFEST.in README.twisted NEWS AUTHORS LICENSE README

+ 0 - 334
desktop/core/ext-py/eventlet-0.9.14/NEWS

@@ -1,334 +0,0 @@
-0.9.14
-======
-* Many fixes to the ZeroMQ hub, which now requires version 2.0.10 or later.  Thanks to Ben Ford.
-* ZeroMQ hub no longer depends on pollhub, and thus works on Windows (thanks, Alexey Borzenkov)
-* Better handling of connect errors on Windows, thanks again to Alexey Borzenkov.
-* More-robust Event delivery, thanks to Malcolm Cleaton
-* wsgi.py now distinguishes between an empty query string ("") and a non-existent query string (no entry in environ).
-* wsgi.py handles ipv6 correctly (thanks, redbo)
-* Better behavior in tpool when you give it nonsensical numbers, thanks to R. Tyler for the nonsense.  :)
-* Fixed importing on 2.5 (#73, thanks to Ruijun Luo)
-* Hub doesn't hold on to invalid fds (#74, thanks to Edward George)
-* Documentation for eventlet.green.zmq, courtesy of Ben Ford
-
-0.9.13
-======
-* ZeroMQ hub, and eventlet.green.zmq make supersockets green.  Thanks to Ben Ford!
-* eventlet.green.MySQLdb added.  It's an interface to MySQLdb that uses tpool to make it appear nonblocking
-* Greenthread affinity in tpool.  Each greenthread is assigned to the same thread when using tpool, making it easier to work with non-thread-safe libraries.
-* Eventlet now depends on greenlet 0.3 or later.
-* Fixed a hang when using tpool during an import causes another import.  Thanks to mikepk for tracking that down.
-* Improved websocket draft 76 compliance, thanks to Nick V.
-* Rare greenthread.kill() bug fixed, which was probably brought about by a bugfix in greenlet 0.3.
-* Easy_installing eventlet should no longer print an ImportError about greenlet
-* Support for serving up SSL websockets, thanks to chwagssd for reporting #62
-* eventlet.wsgi properly sets 'wsgi.url_scheme' environment variable to 'https', and 'HTTPS' to 'on' if serving over ssl
-* Blocking detector uses setitimer on 2.6 or later, allowing for sub-second block detection, thanks to rtyler.
-* Blocking detector is documented now, too
-* socket.create_connection properly uses dnspython for nonblocking dns.  Thanks to rtyler.
-* Removed EVENTLET_TPOOL_DNS, nobody liked that.  But if you were using it, install dnspython instead.  Thanks to pigmej and gholt.
-* Removed _main_wrapper from greenthread, thanks to Ambroff adding keyword arguments to switch() in 0.3!
-
-0.9.12
-======
-* Eventlet no longer uses the Twisted hub if Twisted is imported -- you must call eventlet.hubs.use_hub('twistedr') if you want to use it.  This prevents strange race conditions for those who want to use both Twisted and Eventlet separately.
-* Removed circular import in twistedr.py
-* Added websocket multi-user chat example
-* Not using exec() in green modules anymore.
-* eventlet.green.socket now contains all attributes of the stdlib socket module, even those that were left out by bugs.
-* Eventlet.wsgi doesn't call print anymore, instead uses the logfiles for everything (it used to print exceptions in one place).
-* Eventlet.wsgi properly closes the connection when an error is raised
-* Better documentation on eventlet.event.Event.send_exception
-* Adding websocket.html to tarball so that you can run the examples without checking out the source
-
-0.9.10
-======
-* Greendns: if dnspython is installed, Eventlet will automatically use it to provide non-blocking DNS queries.  Set the environment variable 'EVENTLET_NO_GREENDNS' if you don't want greendns but have dnspython installed.
-* Full test suite passes on Python 2.7.
-* Tests no longer depend on simplejson for >2.6.
-* Potential-bug fixes in patcher (thanks to Schmir, and thanks to Hudson)
-* Websockets work with query strings (thanks to mcarter)
-* WSGI posthooks that get called after the request completed (thanks to gholt, nice docs, too)
-* Blocking detector merged -- use it to detect places where your code is not yielding to the hub for > 1 second.
-* tpool.Proxy can wrap callables
-* Tweaked Timeout class to do something sensible when True is passed to the constructor
-
-0.9.9
-=====
-* A fix for monkeypatching on systems with psycopg version 2.0.14.
-* Improved support for chunked transfers in wsgi, plus a bunch of tests from schmir (ported from gevent by redbo)
-* A fix for the twisted hub from Favo Yang
-
-0.9.8
-=====
-* Support for psycopg2's asynchronous mode, from Daniele Varrazzo
-* websocket module is now part of core Eventlet with 100% unit test coverage thanks to Ben Ford.  See its documentation at http://eventlet.net/doc/modules/websocket.html
-* Added wrap_ssl convenience method, meaning that we truly no longer need api or util modules.
-* Multiple-reader detection code protects against the common mistake of having multiple greenthreads read from the same socket at the same time, which can be overridden if you know what you're doing.
-* Cleaner monkey_patch API: the "all" keyword is no longer necessary.
-* Pool objects have a more convenient constructor -- no more need to subclass
-* amajorek's reimplementation of GreenPipe
-* Many bug fixes, major and minor.
-
-0.9.7
-=====
-* GreenPipe is now a context manager (thanks, quad)
-* tpool.Proxy supports iterators properly
-* bug fixes in eventlet.green.os (thanks, Benoit)
-* much code cleanup from Tavis
-* a few more example apps
-* multitudinous improvements in Py3k compatibility from amajorek
-
-
-0.9.6
-=====
-* new EVENTLET_HUB environment variable allows you to select a hub without code
-* improved GreenSocket and GreenPipe compatibility with stdlib
-* bugfixes on GreenSocket and GreenPipe objects
-* code coverage increased across the board
-* Queue resizing
-* internal DeprecationWarnings largely eliminated
-* tpool is now reentrant (i.e., can call tpool.execute(tpool.execute(foo)))
-* more reliable access to unpatched modules reduces some race conditions when monkeypatching
-* completely threading-compatible corolocal implementation, plus tests and enthusiastic adoption
-* tests stomp on each others' toes less
-* performance improvements in timers, hubs, greenpool
-* Greenlet-aware profile module courtesy of CCP
-* support for select26 module's epoll
-* better PEP-8 compliance and import cleanup
-* new eventlet.serve convenience function for easy TCP servers
-
-
-0.9.5
-=====
-* support psycopg in db_pool
-* smart patcher that does the right patching when importing without needing to understand plumbing of patched module
-* patcher.monkey_patch() method replacing util.wrap_*
-* monkeypatch threading support
-* removed api.named
-* imported timeout module from gevent, replace exc_after and with_timeout()
-* replace call_after with spawn_after; this is so that users don't see the Timer class
-* added cancel() method to GreenThread to support the semantic of "abort if not already in the middle of something"
-* eventlet.green.os with patched read() and write(), etc
-* moved stuff from wrap_pipes_with_coroutine_pipe into green.os
-* eventlet.green.subprocess instead of eventlet.processes
-* improve patching docs, explaining more about patcher and why you'd use eventlet.green
-* better documentation on greenpiles
-* deprecate api.py completely
-* deprecate util.py completely
-* deprecate saranwrap
-* performance improvements in the hubs
-* much better documentation overall
-* new convenience functions: eventlet.connect and eventlet.listen.  Thanks, Sergey!
-
-
-0.9.4
-=====
-* Deprecated coros.Queue and coros.Channel (use queue.Queue instead)
-* Added putting and getting methods to queue.Queue.
-* Added eventlet.green.Queue which is a greened clone of stdlib Queue, along with stdlib tests.
-* Changed __init__.py so that the version number is readable even if greenlet's not installed.
-* Bugfixes in wsgi, greenpool
-
-0.9.3
-=====
-
-* Moved primary api module to __init__ from api.  It shouldn't be necessary to import eventlet.api anymore; import eventlet should do the same job.
-* Proc module deprecated in favor of greenthread
-* New module greenthread, with new class GreenThread.
-* New GreenPool class that replaces pool.Pool.
-* Deprecated proc module (use greenthread module instead)
-* tpooled gethostbyname is configurable via environment variable EVENTLET_TPOOL_GETHOSTBYNAME
-* Removed greenio.Green_fileobject and refactored the code therein to be more efficient.  Only call makefile() on sockets now; makeGreenFile() is deprecated.  The main loss here is that of the readuntil method.  Also, Green_fileobjects used to be auto-flushing; flush() must be called explicitly now.
-* Added epoll support
-* Improved documentation across the board.
-* New queue module, API-compatible with stdlib Queue
-* New debug module, used for enabling verbosity within Eventlet that can help debug applications or Eventlet itself.
-* Bugfixes in tpool, green.select, patcher
-* Deprecated coros.execute (use eventlet.spawn instead)
-* Deprecated coros.semaphore (use semaphore.Semaphore or semaphore.BoundedSemaphore instead)
-* Moved coros.BoundedSemaphore to semaphore.BoundedSemaphore
-* Moved coros.Semaphore to semaphore.Semaphore
-* Moved coros.event to event.Event
-* Deprecated api.tcp_listener, api.connect_tcp, api.ssl_listener
-* Moved get_hub, use_hub, get_default_hub from eventlet.api to eventlet.hubs
-* Renamed libevent hub to pyevent.
-* Removed previously-deprecated features tcp_server, GreenSSL, erpc, and trap_errors.
-* Removed saranwrap as an option for making db connections nonblocking in db_pool.
-
-0.9.2
-=====
-
-* Bugfix for wsgi.py where it was improperly expecting the environ variable to be a constant when passed to the application.
-* Tpool.py now passes its tests on Windows.
-* Fixed minor performance issue in wsgi.
-
-0.9.1
-=====
-
-* PyOpenSSL is no longer required for Python 2.6: use the eventlet.green.ssl module. 2.5 and 2.4 still require PyOpenSSL.
-* Cleaned up the eventlet.green packages and their associated tests, this should result in fewer version-dependent bugs with these modules.
-* PyOpenSSL is now fully wrapped in eventlet.green.OpenSSL; using it is therefore more consistent with using other green modules.
-* Documentation on using SSL added.
-* New green modules: ayncore, asynchat, SimpleHTTPServer, CGIHTTPServer, ftplib.
-* Fuller thread/threading compatibility: patching threadlocal with corolocal so coroutines behave even more like threads.
-* Improved Windows compatibility for tpool.py
-* With-statement compatibility for pools.Pool objects.
-* Refactored copyrights in the files, added LICENSE and AUTHORS files.
-* Added support for logging x-forwarded-for header in wsgi.
-* api.tcp_server is now deprecated, will be removed in a future release.
-* Added instructions on how to generate coverage reports to the documentation.
-* Renamed GreenFile to Green_fileobject, to better reflect its purpose.
-* Deprecated erpc method in tpool.py
-* Bug fixes in: wsgi.py, twistedr.py, poll.py, greenio.py, util.py, select.py, processes.py, selects.py
-
-0.9.0
-=====
-
-* Full-duplex sockets (simultaneous readers and writers in the same process).
-* Remove modules that distract from the core mission of making it straightforward to write event-driven networking apps: 
-    httpd, httpc, channel, greenlib, httpdate, jsonhttp, logutil
-* Removed test dependency on sqlite, using nose instead.
-* Marked known-broken tests using nose's mechanism (most of these are not broken but are simply run in the incorrect context, such as threading-related tests that are incompatible with the libevent hub).
-* Remove copied code from python standard libs (in tests).
-* Added eventlet.patcher which can be used to import "greened" modules.
-
-0.8.16
-======
-* GreenSSLObject properly masks ZeroReturnErrors with an empty read; with unit test.
-* Fixed 2.6 SSL compatibility issue.
-
-0.8.15
-======
-
-* GreenSSL object no longer converts ZeroReturnErrors into empty reads, because that is more compatible with the underlying SSLConnection object.
-* Fixed issue caused by SIGCHLD handler in processes.py
-* Stopped supporting string exceptions in saranwrap and fixed a few test failures.
-
-0.8.14
-======
-* Fixed some more Windows compatibility problems, resolving EVT-37 : 
-http://jira.secondlife.com/browse/EVT-37
-* waiting() method on Pool class, which was lost when the Pool implementation
-replaced CoroutinePool.
-
-0.8.13
-======
-* 2.6 SSL compatibility patch by Marcus Cavanaugh.
-* Added greenlet and pyopenssl as dependencies in setup.py.
-
-0.8.12
-======
-
-* The ability to resize() pools of coroutines, which was lost when the 
-Pool implementation replaced CoroutinePool.
-* Fixed Cesar's issue with SSL connections, and furthermore did a 
-complete overhaul of SSL handling in eventlet so that it's much closer 
-to the behavior of the built-in libraries.  In particular, users of 
-GreenSSL sockets must now call shutdown() before close(), exactly 
-like SSL.Connection objects.
-* A small patch that makes Eventlet work on Windows.  This is the first 
-release of Eventlet that works on Windows.
-
-0.8.11
-======
-
-Eventlet can now run on top of twisted reactor. Twisted-based hub is enabled automatically if
-twisted.internet.reactor is imported. It is also possible to "embed" eventlet into a twisted
-application via eventlet.twistedutil.join_reactor. See the examples for details.
-
-A new package, eventlet.twistedutil, is added that makes integration of twisted and eventlet
-easier. It has block_on function that allows to wait for a Deferred to fire and it wraps
-twisted's Protocol in a synchronous interface. This is similar to and is inspired by Christopher
-Armstrong's corotwine library. Thanks to Dan Pascu for reviewing the package.
-
-Another new package, eventlet.green, was added to provide some of the standard modules
-that are fixed not to block other greenlets. This is an alternative to monkey-patching
-the socket, which is impossible to do if you are running twisted reactor.
-The package includes socket, httplib, urllib2.
-
-Much of the core functionality has been refactored and cleaned up, including the removal
-of eventlet.greenlib. This means that it is now possible to use plain greenlets without
-modification in eventlet, and the subclasses of greenlet instead of the old
-eventlet.greenlib.GreenletContext. Calling eventlet.api.get_hub().switch() now checks to
-see whether the current greenlet has a "switch_out" method and calls it if so, providing the
-same functionality that the GreenletContext.swap_out used to. The swap_in behavior can be
-duplicated by overriding the switch method, and the finalize functionality can be duplicated
-by having a try: finally: block around the greenlet's main implementation. The eventlet.backdoor
-module has been ported to this new scheme, although it's signature had to change slightly so
-existing code that used the backdoor will have to be modified.
-
-A number of bugs related to improper scheduling of switch calls has been fixed.
-The fixed functions and classes include api.trampoline, api.sleep, coros.event,
-coros.semaphore, coros.queue.
-
-Many methods of greenio.GreenSocket were fixed to make its behavior more like that of a regular
-socket. Thanks to Marcin Bachry for fixing GreenSocket.dup to preserve the timeout.
-
-Added proc module which provides an easy way to subscribe to coroutine's results. This makes
-it easy to wait for a single greenlet or for a set of greenlets to complete.
-
-wsgi.py now supports chunked transfer requests (patch by Mike Barton)
-
-The following modules were deprecated or removed because they were broken:
-hubs.nginx, hubs.libev, support.pycurls, support.twisteds, cancel method of coros.event class
-
-The following classes are still present but will be removed in the future version:
-- channel.channel (use coros.Channel)
-- coros.CoroutinePool (use pool.Pool)
-
-saranwrap.py now correctly closes the child process when the referring object is deleted,
-received some fixes to its detection of child process death, now correctly deals with the in
-keyword, and it is now possible to use coroutines in a non-blocking fashion in the child process.
-
-Time-based expiry added to db_pool.  This adds the ability to expire connections both by idleness
-and also by total time open.  There is also a connection timeout option.
-
-A small bug in httpd's error method was fixed.
-
-Python 2.3 is no longer supported.
-
-A number of tests was added along with a script to run all of them for all the configurations.
-The script generates an html page with the results.
-
-Thanks to Brian Brunswick for investigation of popen4 badness (eventlet.process)
-Thanks to Marcus Cavanaugh for pointing out some coros.queue(0) bugs.
-
-The twisted integration as well as many other improvements were funded by AG Projects (http://ag-projects.com), thanks!
-
-0.8.x
-=====
-
-Fix a CPU leak that would cause the poll hub to consume 100% CPU in certain conditions, for example the echoserver example. (Donovan Preston)
-
-Fix the libev hub to match libev's callback signature. (Patch by grugq)
-
-Add a backlog argument to api.tcp_listener (Patch by grugq)
-
-0.7.x
-=====
-
-Fix a major memory leak when using the libevent or libev hubs. Timers were not being removed from the hub after they fired. (Thanks Agusto Becciu and the grugq). Also, make it possible to call wrap_socket_with_coroutine_socket without using the threadpool to make dns operations non-blocking (Thanks the grugq).
-
-It's now possible to use eventlet's SSL client to talk to eventlet's SSL server. (Thanks to Ryan Williams)
-
-Fixed a major CPU leak when using select hub. When adding a descriptor to the hub, entries were made in all three dictionaries, readers, writers, and exc, even if the callback is None. Thus every fd would be passed into all three lists when calling select regardless of whether there was a callback for that event or not. When reading the next request out of a keepalive socket, the socket would come back as ready for writing, the hub would notice the callback is None and ignore it, and then loop as fast as possible consuming CPU.
-
-0.6.x
-=====
-
-Fixes some long-standing bugs where sometimes failures in accept() or connect() would cause the coroutine that was waiting to be double-resumed, most often resulting in SwitchingToDeadGreenlet exceptions as well as weird tuple-unpacking exceptions in the CoroutinePool main loop.
-
-0.6.1: Added eventlet.tpool.killall. Blocks until all of the threadpool threads have been told to exit and join()ed. Meant to be used to clean up the threadpool on exit or if calling execv. Used by Spawning.
-
-0.5.x
-=====
-
-"The Pycon 2008 Refactor": The first release which incorporates libevent support. Also comes with significant refactoring and code cleanup, especially to the eventlet.wsgi http server. Docstring coverage is much higher and there is new extensive documentation: http://wiki.secondlife.com/wiki/Eventlet/Documentation
-
-The point releases of 0.5.x fixed some bugs in the wsgi server, most notably handling of Transfer-Encoding: chunked; previously, it would happily send chunked encoding to clients which asked for HTTP/1.0, which isn't legal.
-
-0.2
-=====
-
-Initial re-release of forked linden branch.

+ 0 - 68
desktop/core/ext-py/eventlet-0.9.14/PKG-INFO

@@ -1,68 +0,0 @@
-Metadata-Version: 1.0
-Name: eventlet
-Version: 0.9.14
-Summary: Highly concurrent networking library
-Home-page: http://eventlet.net
-Author: Linden Lab
-Author-email: eventletdev@lists.secondlife.com
-License: UNKNOWN
-Description: Eventlet is a concurrent networking library for Python that allows you to change how you run your code, not how you write it.
-        
-        It uses epoll or libevent for highly scalable non-blocking I/O.  Coroutines ensure that the developer uses a blocking style of programming that is similar to threading, but provide the benefits of non-blocking I/O.  The event dispatch is implicit, which means you can easily use Eventlet from the Python interpreter, or as a small part of a larger application.
-        
-        It's easy to get started using Eventlet, and easy to convert existing 
-        applications to use it.  Start off by looking at the `examples`_, 
-        `common design patterns`_, and the list of `basic API primitives`_.
-        
-        .. _examples: http://eventlet.net/doc/examples.html
-        .. _common design patterns: http://eventlet.net/doc/design_patterns.html
-        .. _basic API primitives: http://eventlet.net/doc/basic_usage.html
-        
-        Quick Example
-        ===============
-        
-        Here's something you can try right on the command line::
-        
-            % python
-            >>> import eventlet 
-            >>> from eventlet.green import urllib2
-            >>> gt = eventlet.spawn(urllib2.urlopen, 'http://eventlet.net')
-            >>> gt2 = eventlet.spawn(urllib2.urlopen, 'http://secondlife.com')
-            >>> gt2.wait()
-            >>> gt.wait()
-        
-        
-        Getting Eventlet
-        ==================
-        
-        The easiest way to get Eventlet is to use easy_install or pip::
-        
-          easy_install eventlet
-          pip install eventlet
-        
-        The development `tip`_ is available via easy_install as well::
-        
-          easy_install 'eventlet==dev'
-          pip install 'eventlet==dev'
-        
-        .. _tip: http://bitbucket.org/which_linden/eventlet/get/tip.zip#egg=eventlet-dev
-        
-        Building the Docs Locally
-        =========================
-        
-        To build a complete set of HTML documentation, you must have Sphinx, which can be found at http://sphinx.pocoo.org/ (or installed with `easy_install sphinx`)
-        
-          cd doc
-          make html
-          
-        The built html files can be found in doc/_build/html afterward.
-Platform: UNKNOWN
-Classifier: License :: OSI Approved :: MIT License
-Classifier: Programming Language :: Python
-Classifier: Operating System :: MacOS :: MacOS X
-Classifier: Operating System :: POSIX
-Classifier: Operating System :: Microsoft :: Windows
-Classifier: Topic :: Internet
-Classifier: Topic :: Software Development :: Libraries :: Python Modules
-Classifier: Intended Audience :: Developers
-Classifier: Development Status :: 4 - Beta

+ 0 - 50
desktop/core/ext-py/eventlet-0.9.14/README

@@ -1,50 +0,0 @@
-Eventlet is a concurrent networking library for Python that allows you to change how you run your code, not how you write it.
-
-It uses epoll or libevent for highly scalable non-blocking I/O.  Coroutines ensure that the developer uses a blocking style of programming that is similar to threading, but provide the benefits of non-blocking I/O.  The event dispatch is implicit, which means you can easily use Eventlet from the Python interpreter, or as a small part of a larger application.
-
-It's easy to get started using Eventlet, and easy to convert existing 
-applications to use it.  Start off by looking at the `examples`_, 
-`common design patterns`_, and the list of `basic API primitives`_.
-
-.. _examples: http://eventlet.net/doc/examples.html
-.. _common design patterns: http://eventlet.net/doc/design_patterns.html
-.. _basic API primitives: http://eventlet.net/doc/basic_usage.html
-
-Quick Example
-===============
-
-Here's something you can try right on the command line::
-
-    % python
-    >>> import eventlet 
-    >>> from eventlet.green import urllib2
-    >>> gt = eventlet.spawn(urllib2.urlopen, 'http://eventlet.net')
-    >>> gt2 = eventlet.spawn(urllib2.urlopen, 'http://secondlife.com')
-    >>> gt2.wait()
-    >>> gt.wait()
-
-
-Getting Eventlet
-==================
-
-The easiest way to get Eventlet is to use easy_install or pip::
-
-  easy_install eventlet
-  pip install eventlet
-
-The development `tip`_ is available via easy_install as well::
-
-  easy_install 'eventlet==dev'
-  pip install 'eventlet==dev'
-
-.. _tip: http://bitbucket.org/which_linden/eventlet/get/tip.zip#egg=eventlet-dev
-
-Building the Docs Locally
-=========================
-
-To build a complete set of HTML documentation, you must have Sphinx, which can be found at http://sphinx.pocoo.org/ (or installed with `easy_install sphinx`)
-
-  cd doc
-  make html
-  
-The built html files can be found in doc/_build/html afterward.

+ 0 - 181
desktop/core/ext-py/eventlet-0.9.14/README.twisted

@@ -1,181 +0,0 @@
---work in progress--
-
-Introduction
-------------
-Twisted provides solid foundation for asynchronous programming in Python.
-Eventlet makes asynchronous programming look like synchronous, thus
-achieving higher signal-to-noise ratio than traditional twisted programs have.
-
-Eventlet on top of twisted provides:
- * stable twisted
- * usable and readable synchronous style
- * existing twisted code can be used without any changes
- * existing blocking code can be used after trivial changes applied
-
-NOTE: the maintainer of Eventlet's Twisted support no longer supports it; it still exists but may have had some breakage along the way.  Please treat it as experimental, and if you'd like to maintain it, please do!
-
-Eventlet features:
-
- * utilities for spawning and controlling greenlet execution:
-   api.spawn, api.kill, proc module
- * utilities for communicating between greenlets:
-   event.Event, queue.Queue, semaphore.Semaphore
- * standard Python modules that won't block the reactor:
-   eventlet.green package
- * utilities specific to twisted hub:
-   eventlet.twistedutil package
-
-
-Getting started with eventlet on twisted
-----------------------------------------
-
-This section will only mention stuff that may be useful but it
-won't explain in details how to use it. For that, refer to the
-docstrings of the modules and the examples.
-
-There are 2 ways of using twisted with eventlet, one that is
-familiar to twisted developers and another that is familiar
-to eventlet developers:
-
- 1. explicitly start the main loop in the main greenlet;
- 2. implicitly start the main loop in a dedicated greenlet.
-
-To enable (1), add this line at the top of your program:
-from eventlet.twistedutil import join_reactor
-then start the reactor as you would do in a regular twisted application.
-
-For (2) just make sure that you have reactor installed before using
-any of eventlet functions. Otherwise a non-twisted hub will be selected
-and twisted code won't work.
-
-Most of examples/twisted_* use twisted style with the exception of
-twisted_client.py and twisted_srvconnector.py. All of the non-twisted
-examples in examples directory use eventlet-style (they work with any
-of eventlet's hubs, not just twisted-based).
-
-Eventlet implements "blocking" operations by switching to the main loop
-greenlet, thus it's impossible to call a blocking function when you are
-already in the main loop. Therefore one must be cautious in a twisted
-callback, calling only a non-blocking subset of eventlet API here. The
-following functions won't unschedule the current greenlet and are safe
-to call from anywhere:
-
-1. Greenlet creation functions: api.spawn, proc.spawn,
-   twistedutil.deferToGreenThread and others based on api.spawn.
-
-2. send(), send_exception(), poll(), ready() methods of event.Event
-   and queue.Queue.
-
-3. wait(timeout=0) is identical to poll(). Currently only Proc.wait
-   supports timeout parameter.
-
-4. Proc.link/link_value/link_exception
-
-Other classes that use these names should follow the convention.
-
-For an example on how to take advantage of eventlet in a twisted
-application using deferToGreenThread see examples/twisted_http_proxy.py
-
-Although eventlet provides eventlet.green.socket module that implements
-interface of the standard Python socket, there's also a way to use twisted's
-network code in a synchronous fashion via GreenTransport class.
-A GreenTransport interface is reminiscent of socket but it's not a drop-in
-replacement. It combines features of TCPTransport and Protocol in a single
-object:
-
- * all of transport methods (like getPeer()) are available directly on
-   a GreenTransport instance; in addition, underlying transport object
-   is available via 'transport' attribute;
- * write method is overriden: it may block if transport write buffer is full;
- * read() and recv() methods are provided to retrieve the data from protocol
-   synchronously.
-
-To make a GreenTransport instance use twistedutil.protocol.GreenClientCreator
-(usage is similar to that of twisted.internet.protocol.ClientCreator)
-
-For an example on how to get a connected GreenTransport instance,
-see twisted_client.py, twisted_srvconnect.py or twisted_portforward.py.
-For an example on how to use GreenTransport for incoming connections,
-see twisted_server.py, twisted_portforward.py.
-
-
-also
-* twistedutil.block_on - wait for a deferred to fire
-  block_on(reactor.callInThread(func, args))
-* twistedutil.protocol.basic.LineOnlyReceiverTransport - a green transport
-  variant built on top of LineOnlyReceiver protocol. Demonstrates how
-  to convert a protocol to a synchronous mode.
-
-
-Coroutines
-----------
-
-To understand how eventlet works, one has to understand how to use greenlet:
-http://codespeak.net/py/dist/greenlet.html
-
-Essential points
-
-* There always exists MAIN greenlet
-* Every greenlet except MAIN has a parent. MAIN therefore could be detected as g.parent is None
-* When greenlet is finished it's return value is propagated to the parent (i.e. switch() call
-  in the parent greenlet returns it)
-* When an exception leaves a greelen, it's propagated to the parent (i.e. switch() in the parent
-  re-raises it) unless it's a subclass of GreenletExit, which is returned as a value.
-* parent can be reassigned (by simply setting 'parent' attribute). A cycle would be detected and
-  rejected with ValueError
-
-
-Note, that there's no scheduler of any sort; if a coroutine wants to be
-scheduled again it must take care of it itself. As an application developer,
-however, you don't need to worry about it as that's what eventlet does behind
-the scenes. The cost of that is that you should not use greenlet's switch() and
-throw() methods, they will likely leave the current greenlet unscheduled
-forever. Eventlet also takes advantage of greenlet's `parent' attribute,
-so you should not meddle with it either.
-
-
-How does eventlet work
-----------------------
-
-Twisted's reactor and eventlet's hub are very similar in what they do.
-Both continuously perform polling on the list of registered descriptors
-and each time a specific event is fired, the associated callback function
-is called. In addition, both maintain a list of scheduled calls.
-
-Polling is performed by the main loop - a function that both reactor and hub have.
-When twisted calls user's callback it's expected to return almost immediately,
-without any blocking I/O calls.
-
-Eventlet runs the main loop in a dedicated greenlet (MAIN_LOOP). It is the same
-greenlet as MAIN if you use join_reactor. Otherwise it's a separate greenlet
-started implicitly. The execution is organized in a such way that the switching
-always involves MAIN_LOOP. All of functions in eventlet that appear "blocking"
-use the following algorithm:
-
-1. register a callback that switches back to the current greenlet when
-   an event of interest happens
-2. switch to the MAIN_LOOP
-
-For example, here's what eventlet's socket recv() does:
-
-= blocking operation RECV on socket d =
-
-user's greenlet (USER)             main loop's greenlet (MAIN_LOOP)
-      |
-(inside d.recv() call)
-      |
-add_descriptor(d, RECV)
-      |
-data=MAIN_LOOP.switch() ---------> poll for events
-  ^---------------------\               |
-                        |              ... ---------------------------> may execute other greenlets here
-                        |               |
-                        |          event RECV on descriptor d?
-                        |               |
-                        |          d.remove_descriptor(d, RECV)
-                        |               |
-                        |          data = d.recv() # calling blocking op that will return immediately
-                        |               |
-                        \--------- USER.switch(data) # argument data here becomes return value in user's switch
-  return data
-

+ 0 - 94
desktop/core/ext-py/eventlet-0.9.14/doc/Makefile

@@ -1,94 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS    =
-SPHINXBUILD   = PYTHONPATH=../:$(PYTHONPATH) sphinx-build
-PAPER         =
-
-# Internal variables.
-PAPEROPT_a4     = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS   = -d _build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-
-.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
-
-help:
-	@echo "Please use \`make <target>' where <target> is one of"
-	@echo "  html      to make standalone HTML files"
-	@echo "  dirhtml   to make HTML files named index.html in directories"
-	@echo "  pickle    to make pickle files"
-	@echo "  json      to make JSON files"
-	@echo "  htmlhelp  to make HTML files and a HTML help project"
-	@echo "  qthelp    to make HTML files and a qthelp project"
-	@echo "  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
-	@echo "  changes   to make an overview of all changed/added/deprecated items"
-	@echo "  linkcheck to check all external links for integrity"
-	@echo "  doctest   to run all doctests embedded in the documentation (if enabled)"
-	@echo "  coverage  to generate a docstring coverage report"
-
-clean:
-	-rm -rf _build/*
-
-html:
-	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) _build/html
-	@echo
-	@echo "Build finished. The HTML pages are in _build/html."
-
-dirhtml:
-	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) _build/dirhtml
-	@echo
-	@echo "Build finished. The HTML pages are in _build/dirhtml."
-
-pickle:
-	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) _build/pickle
-	@echo
-	@echo "Build finished; now you can process the pickle files."
-
-json:
-	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) _build/json
-	@echo
-	@echo "Build finished; now you can process the JSON files."
-
-htmlhelp:
-	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) _build/htmlhelp
-	@echo
-	@echo "Build finished; now you can run HTML Help Workshop with the" \
-	      ".hhp project file in _build/htmlhelp."
-
-qthelp:
-	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) _build/qthelp
-	@echo
-	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
-	      ".qhcp project file in _build/qthelp, like this:"
-	@echo "# qcollectiongenerator _build/qthelp/Eventlet.qhcp"
-	@echo "To view the help file:"
-	@echo "# assistant -collectionFile _build/qthelp/Eventlet.qhc"
-
-latex:
-	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex
-	@echo
-	@echo "Build finished; the LaTeX files are in _build/latex."
-	@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
-	      "run these through (pdf)latex."
-
-changes:
-	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) _build/changes
-	@echo
-	@echo "The overview file is in _build/changes."
-
-linkcheck:
-	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) _build/linkcheck
-	@echo
-	@echo "Link check complete; look for any errors in the above output " \
-	      "or in _build/linkcheck/output.txt."
-
-doctest:
-	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) _build/doctest
-	@echo "Testing of doctests in the sources finished, look at the " \
-	      "results in _build/doctest/output.txt."
-	      
-coverage:
-	$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) _build/coverage
-	@echo "Coverage report finished, look at the " \
-		  "results in _build/coverage/python.txt."

BIN
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_images/threading_illustration.png


+ 0 - 4
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/authors.txt

@@ -1,4 +0,0 @@
-Authors
-=======
-
-.. include:: ../AUTHORS

+ 0 - 83
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/basic_usage.txt

@@ -1,83 +0,0 @@
-Basic Usage
-=============
-
-If it's your first time to Eventlet, you may find the illuminated examples in the :ref:`design-patterns` document to be a good starting point.
-
-Eventlet is built around the concept of green threads (i.e. coroutines, we use the terms interchangeably) that are launched to do network-related work.  Green threads differ from normal threads in two main ways:
-
-* Green threads are so cheap they are nearly free.  You do not have to conserve green threads like you would normal threads.  In general, there will be at least one green thread per network connection.
-* Green threads cooperatively yield to each other instead of preemptively being scheduled.  The major advantage from this behavior is that shared data structures don't need locks, because only if a yield is explicitly called can another green thread have access to the data structure.  It is also possible to inspect primitives such as queues to see if they have any pending data.
-
-Primary API
-===========
-
-The design goal for Eventlet's API is simplicity and readability.  You should be able to read its code and understand what it's doing.  Fewer lines of code are preferred over excessively clever implementations.  `Like Python itself <http://www.python.org/dev/peps/pep-0020/>`_, there should be one, and only one obvious way to do it in Eventlet!
-
-Though Eventlet has many modules, much of the most-used stuff is accessible simply by doing ``import eventlet``.  Here's a quick summary of the functionality available in the ``eventlet`` module, with links to more verbose documentation on each.
-
-Greenthread Spawn
------------------------
-
-.. function:: eventlet.spawn(func, *args, **kw)
-   
-   This launches a greenthread to call *func*.  Spawning off multiple greenthreads gets work done in parallel.  The return value from ``spawn`` is a :class:`greenthread.GreenThread` object, which can be used to retrieve the return value of *func*.  See :func:`spawn <eventlet.greenthread.spawn>` for more details.
-   
-.. function:: eventlet.spawn_n(func, *args, **kw)
-   
-   The same as :func:`spawn`, but it's not possible to know how the function terminated (i.e. no return value or exceptions).  This makes execution faster.  See :func:`spawn_n <eventlet.greenthread.spawn_n>` for more details.
-
-.. function:: eventlet.spawn_after(seconds, func, *args, **kw)
-   
-    Spawns *func* after *seconds* have elapsed; a delayed version of :func:`spawn`.   To abort the spawn and prevent *func* from being called, call :meth:`GreenThread.cancel` on the return value of :func:`spawn_after`.  See :func:`spawn_after <eventlet.greenthread.spawn_after>` for more details.
-
-Greenthread Control
------------------------
-
-.. function:: eventlet.sleep(seconds=0)
-
-    Suspends the current greenthread and allows others a chance to process.  See :func:`sleep <eventlet.greenthread.sleep>` for more details.
-
-.. class:: eventlet.GreenPool
-
-   Pools control concurrency.  It's very common in applications to want to consume only a finite amount of memory, or to restrict the amount of connections that one part of the code holds open so as to leave more for the rest, or to behave consistently in the face of unpredictable input data.  GreenPools provide this control.  See :class:`GreenPool <eventlet.greenpool.GreenPool>` for more on how to use these.
-
-.. class:: eventlet.GreenPile
-
-    GreenPile objects represent chunks of work.  In essence a GreenPile is an iterator that can be stuffed with work, and the results read out later. See :class:`GreenPile <eventlet.greenpool.GreenPile>` for more details.
-    
-.. class:: eventlet.Queue
-
-    Queues are a fundamental construct for communicating data between execution units.  Eventlet's Queue class is used to communicate between greenthreads, and provides a bunch of useful features for doing that.  See :class:`Queue <eventlet.queue.Queue>` for more details.
-    
-.. class:: eventlet.Timeout
-
-    This class is a way to add timeouts to anything.  It raises *exception* in the current greenthread after *timeout* seconds.  When *exception* is omitted or ``None``, the Timeout instance itself is raised.
-    
-    Timeout objects are context managers, and so can be used in with statements.
-    See :class:`Timeout <eventlet.timeout.Timeout>` for more details.
-
-Patching Functions
----------------------
-    
-.. function:: eventlet.import_patched(modulename, *additional_modules, **kw_additional_modules)
-
-    Imports a module in a way that ensures that the module uses "green" versions of the standard library modules, so that everything works nonblockingly.  The only required argument is the name of the module to be imported.  For more information see :ref:`import-green`.
-
-.. function:: eventlet.monkey_patch(all=True, os=False, select=False, socket=False, thread=False, time=False)
-
-    Globally patches certain system modules to be greenthread-friendly. The keyword arguments afford some control over which modules are patched. If *all* is True, then all modules are patched regardless of the other arguments. If it's False, then the rest of the keyword arguments control patching of specific subsections of the standard library.  Most patch the single module of the same name (os, time, select).  The exceptions are socket, which also patches the ssl module if present; and thread, which patches thread, threading, and Queue.  It's safe to call monkey_patch multiple times.  For more information see :ref:`monkey-patch`.
-
-Network Convenience Functions
-------------------------------
-
-.. autofunction:: eventlet.connect
-
-.. autofunction:: eventlet.listen
-
-.. autofunction:: eventlet.wrap_ssl
-
-.. autofunction:: eventlet.serve
-
-.. autoclass:: eventlet.StopServe
-    
-These are the basic primitives of Eventlet; there are a lot more out there in the other Eventlet modules; check out the :doc:`modules`.

+ 0 - 113
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/design_patterns.txt

@@ -1,113 +0,0 @@
-.. _design-patterns:
-
-Design Patterns
-=================
-
-There are a bunch of basic patterns that Eventlet usage falls into.  Here are a few examples that show their basic structure.
-
-Client Pattern
---------------------
-
-The canonical client-side example is a web crawler.  This use case is given a list of urls and wants to retrieve their bodies for later processing.  Here is a very simple example::
-
-
-  urls = ["http://www.google.com/intl/en_ALL/images/logo.gif",
-         "https://wiki.secondlife.com/w/images/secondlife.jpg",
-         "http://us.i1.yimg.com/us.yimg.com/i/ww/beta/y3.gif"]
-  
-  import eventlet
-  from eventlet.green import urllib2  
-
-  def fetch(url):
-      return urllib2.urlopen(url).read()
-  
-  pool = eventlet.GreenPool()
-  for body in pool.imap(fetch, urls):
-      print "got body", len(body)
-
-There is a slightly more complex version of this in the :ref:`web crawler example <web_crawler_example>`.  Here's a tour of the interesting lines in this crawler. 
-
-``from eventlet.green import urllib2`` is how you import a cooperatively-yielding version of urllib2.  It is the same in all respects to the standard version, except that it uses green sockets for its communication.  This is an example of the :ref:`import-green` pattern.
-
-``pool = eventlet.GreenPool()`` constructs a :class:`GreenPool <eventlet.greenpool.GreenPool>` of a thousand green threads.  Using a pool is good practice because it provides an upper limit on the amount of work that this crawler will be doing simultaneously, which comes in handy when the input data changes dramatically.
-
-``for body in pool.imap(fetch, urls):`` iterates over the results of calling the fetch function in parallel.  :meth:`imap <eventlet.greenpool.GreenPool.imap>` makes the function calls in parallel, and the results are returned in the order that they were executed.
-
-The key aspect of the client pattern is that it involves collecting the results of each function call; the fact that each fetch is done concurrently is essentially an invisible optimization.  Note also that imap is memory-bounded and won't consume gigabytes of memory if the list of urls grows to the tens of thousands (yes, we had that problem in production once!).
-
-
-Server Pattern
---------------------
-
-Here's a simple server-side example, a simple echo server::
-    
-    import eventlet
-    
-    def handle(client):
-        while True:
-            c = client.recv(1)
-            if not c: break
-            client.sendall(c)
-    
-    server = eventlet.listen(('0.0.0.0', 6000))
-    pool = eventlet.GreenPool(10000)
-    while True:
-        new_sock, address = server.accept()
-        pool.spawn_n(handle, new_sock)
-
-The file :ref:`echo server example <echo_server_example>` contains a somewhat more robust and complex version of this example.
-
-``server = eventlet.listen(('0.0.0.0', 6000))`` uses a convenience function to create a listening socket.
-
-``pool = eventlet.GreenPool(10000)`` creates a pool of green threads that could handle ten thousand clients.  
-
-``pool.spawn_n(handle, new_sock)`` launches a green thread to handle the new client.  The accept loop doesn't care about the return value of the ``handle`` function, so it uses :meth:`spawn_n <eventlet.greenpool.GreenPool.spawn_n>`, instead of :meth:`spawn <eventlet.greenpool.GreenPool.spawn>`.
-
-The difference between the server and the client patterns boils down to the fact that the server has a ``while`` loop calling ``accept()`` repeatedly, and that it hands off the client socket completely to the handle() method, rather than collecting the results.
-
-Dispatch Pattern
--------------------
-
-One common use case that Linden Lab runs into all the time is a "dispatch" design pattern.  This is a server that is also a client of some other services.  Proxies, aggregators, job workers, and so on are all terms that apply here.  This is the use case that the :class:`GreenPile <eventlet.greenpool.GreenPile>` was designed for.
-
-Here's a somewhat contrived example: a server that receives POSTs from clients that contain a list of urls of RSS feeds.  The server fetches all the feeds concurrently and responds with a list of their titles to the client.  It's easy to imagine it doing something more complex than this, and this could be easily modified to become a Reader-style application::
-
-    import eventlet
-    feedparser = eventlet.import_patched('feedparser')
-    
-    pool = eventlet.GreenPool()
-    
-    def fetch_title(url):
-        d = feedparser.parse(url)
-        return d.feed.get('title', '')
-    
-    def app(environ, start_response):
-        pile = eventlet.GreenPile(pool)
-        for url in environ['wsgi.input'].readlines():
-            pile.spawn(fetch_title, url)
-        titles = '\n'.join(pile)
-        start_response('200 OK', [('Content-type', 'text/plain')])
-        return [titles]
-
-The full version of this example is in the :ref:`feed_scraper_example`, which includes code to start the WSGI server on a particular port.
-
-This example uses a global (gasp) :class:`GreenPool <eventlet.greenpool.GreenPool>` to control concurrency.  If we didn't have a global limit on the number of outgoing requests, then a client could cause the server to open tens of thousands of concurrent connections to external servers, thereby getting feedscraper's IP banned, or various other accidental-or-on-purpose bad behavior.  The pool isn't a complete DoS protection, but it's the bare minimum.
-
-.. highlight:: python
-    :linenothreshold: 1
-
-The interesting lines are in the app function::
-
-    pile = eventlet.GreenPile(pool)
-    for url in environ['wsgi.input'].readlines():
-        pile.spawn(fetch_title, url)
-    titles = '\n'.join(pile)
-
-.. highlight:: python
-    :linenothreshold: 1000
-
-Note that in line 1, the Pile is constructed using the global pool as its argument.  That ties the Pile's concurrency to the global's.  If there are already 1000 concurrent fetches from other clients of feedscraper, this one will block until some of those complete.  Limitations are good!
-
-Line 3 is just a spawn, but note that we don't store any return value from it.  This is because the return value is kept in the Pile itself.  This becomes evident in the next line...
-
-Line 4 is where we use the fact that the Pile is an iterator.  Each element in the iterator is one of the return values from the fetch_title function, which are strings.  We can use a normal Python idiom (:func:`join`) to concatenate these incrementally as they happen.

+ 0 - 21
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/environment.txt

@@ -1,21 +0,0 @@
-.. _env_vars:
-
-Environment Variables
-======================
-
-Eventlet's behavior can be controlled by a few environment variables.
-These are only for the advanced user.
-
-EVENTLET_HUB 
-
-   Used to force Eventlet to use the specified hub instead of the
-   optimal one.  See :ref:`understanding_hubs` for the list of
-   acceptable hubs and what they mean (note that picking a hub not on
-   the list will silently fail).  Equivalent to calling
-   :meth:`eventlet.hubs.use_hub` at the beginning of the program.
-
-EVENTLET_THREADPOOL_SIZE
-
-   The size of the threadpool in :mod:`~eventlet.tpool`.  This is an
-   environment variable because tpool constructs its pool on first
-   use, so any control of the pool size needs to happen before then.

+ 0 - 106
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/examples.txt

@@ -1,106 +0,0 @@
-Examples
-========
-
-Here are a bunch of small example programs that use Eventlet.  All of these examples can be found in the ``examples`` directory of a source copy of Eventlet.
-
-.. _web_crawler_example:
-
-Web Crawler
-------------
-``examples/webcrawler.py``
-
-.. literalinclude:: ../examples/webcrawler.py
-
-.. _wsgi_server_example:
-
-WSGI Server
-------------
-``examples/wsgi.py``
-
-.. literalinclude:: ../examples/wsgi.py
-
-.. _echo_server_example:
-
-Echo Server
------------
-``examples/echoserver.py``
-
-.. literalinclude:: ../examples/echoserver.py
-
-.. _socket_connect_example:
-
-Socket Connect
---------------
-``examples/connect.py``
-
-.. literalinclude:: ../examples/connect.py
-
-.. _chat_server_example:
-
-Multi-User Chat Server
------------------------
-``examples/chat_server.py``
-
-This is a little different from the echo server, in that it broadcasts the 
-messages to all participants, not just the sender.
-        
-.. literalinclude:: ../examples/chat_server.py
-
-.. _feed_scraper_example:
-
-Feed Scraper
------------------------
-``examples/feedscraper.py``
-
-This example requires `Feedparser <http://www.feedparser.org/>`_ to be installed or on the PYTHONPATH.
-
-.. literalinclude:: ../examples/feedscraper.py
-
-.. _forwarder_example:
-
-Port Forwarder
------------------------
-``examples/forwarder.py``
-
-.. literalinclude:: ../examples/forwarder.py
-
-.. _recursive_crawler_example:
-
-Recursive Web Crawler
------------------------------------------
-``examples/recursive_crawler.py``
-
-This is an example recursive web crawler that fetches linked pages from a seed url.
-
-.. literalinclude:: ../examples/recursive_crawler.py
-
-.. _producer_consumer_example:
-
-Producer Consumer Web Crawler
------------------------------------------
-``examples/producer_consumer.py``
-
-This is an example implementation of the producer/consumer pattern as well as being identical in functionality to the recursive web crawler.
-
-.. literalinclude:: ../examples/producer_consumer.py
-
-.. _websocket_example:
-
-Websocket Server Example
---------------------------
-``examples/websocket.py``
-
-This exercises some of the features of the websocket server
-implementation.
-
-.. literalinclude:: ../examples/websocket.py
-
-.. _websocket_chat_example:
-
-Websocket Multi-User Chat Example
------------------------------------
-``examples/websocket_chat.py``
-
-This is a mashup of the websocket example and the multi-user chat example, showing how you can do the same sorts of things with websockets that you can do with regular sockets.
-
-.. literalinclude:: ../examples/websocket_chat.py

+ 0 - 10
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/history.txt

@@ -1,10 +0,0 @@
-History
--------
-
-Eventlet began life as Donovan Preston was talking to Bob Ippolito about coroutine-based non-blocking networking frameworks in Python. Most non-blocking frameworks require you to run the "main loop" in order to perform all network operations, but Donovan wondered if a library written using a trampolining style could get away with transparently running the main loop any time i/o was required, stopping the main loop once no more i/o was scheduled. Bob spent a few days during PyCon 2006 writing a proof-of-concept. He named it eventlet, after the coroutine implementation it used, `greenlet <http://cheeseshop.python.org/pypi/greenlet greenlet>`_. Donovan began using eventlet as a light-weight network library for his spare-time project `Pavel <http://soundfarmer.com/Pavel/trunk/ Pavel>`_, and also began writing some unittests.
-
-* http://svn.red-bean.com/bob/eventlet/trunk/
-
-When Donovan started at Linden Lab in May of 2006, he added eventlet as an svn external in the ``indra/lib/python directory``, to be a dependency of the yet-to-be-named backbone project (at the time, it was named restserv). However, including eventlet as an svn external meant that any time the externally hosted project had hosting issues, Linden developers were not able to perform svn updates. Thus, the eventlet source was imported into the linden source tree at the same location, and became a fork.
-
-Bob Ippolito has ceased working on eventlet and has stated his desire for Linden to take it's fork forward to the open source world as "the" eventlet.

+ 0 - 54
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/hubs.txt

@@ -1,54 +0,0 @@
-.. _understanding_hubs:
-
-Understanding Eventlet Hubs
-===========================
-
-A hub forms the basis of Eventlet's event loop, which dispatches I/O events and schedules greenthreads.  It is the existence of the hub that promotes coroutines (which can be tricky to program with) into greenthreads (which are easy).
-
-Eventlet has multiple hub implementations, and when you start using it, it tries to select the best hub implementation for your system.  The hubs that it supports are (in order of preference):
-
-**epolls**
-    Requires Python 2.6 or the `python-epoll <http://pypi.python.org/pypi/python-epoll/1.0>`_ package, and Linux.  This is the fastest pure-Python hub.
-**poll**
-    On platforms that support it
-**selects**
-    Lowest-common-denominator, available everywhere.
-**pyevent**
-    This is a libevent-based backend and is thus the fastest.  It's disabled by default, because it does not support native threads, but you can enable it yourself if your use case doesn't require them.  (You have to install pyevent, too.)
-
-If the selected hub is not idea for the application, another can be selected.  You can make the selection either with the environment variable :ref:`EVENTLET_HUB <env_vars>`, or with use_hub.
-
-.. function:: eventlet.hubs.use_hub(hub=None)
-
-    Use this to control which hub Eventlet selects.  Call it with the name of the desired hub module.  Make sure to do this before the application starts doing any I/O!  Calling use_hub completely eliminates the old hub, and any file descriptors or timers that it had been managing will be forgotten.  Put the call as one of the first lines in the main module.::
-    
-        """ This is the main module """
-        from eventlet import hubs
-        hubs.use_hub("pyevent")
-    
-    Hubs are implemented as thread-local class instances.  :func:`eventlet.hubs.use_hub` only operates on the current thread.  When using multiple threads that each need their own hub, call :func:`eventlet.hubs.use_hub` at the beginning of each thread function that needs a specific hub.  In practice, it may not be necessary to specify a hub in each thread; it works to use one special hub for the main thread, and let other threads use the default hub; this hybrid hub configuration will work fine.
-    
-    It is also possible to use a third-party hub module in place of one of the built-in ones.  Simply pass the module itself to :func:`eventlet.hubs.use_hub`.  The task of writing such a hub is a little beyond the scope of this document, it's probably a good idea to simply inspect the code of the existing hubs to see how they work.::
-
-         from eventlet import hubs    
-         from mypackage import myhub
-         hubs.use_hub(myhub)
-    
-    Supplying None as the argument to :func:`eventlet.hubs.use_hub` causes it to select the default hub.
-
-
-How the Hubs Work
------------------
-
-The hub has a main greenlet, MAINLOOP.  When one of the running coroutines needs
-to do some I/O, it registers a listener with the hub (so that the hub knows when to wake it up again), and then switches to MAINLOOP (via ``get_hub().switch()``).  If there are other coroutines that are ready to run, MAINLOOP switches to them, and when they complete or need to do more I/O, they switch back to the MAINLOOP.  In this manner, MAINLOOP ensures that every coroutine gets scheduled when it has some work to do.
-
-MAINLOOP is launched only when the first I/O operation happens, and it is not the same greenlet that __main__ is running in.  This lazy launching is why it's not necessary to explicitly call a dispatch() method like other frameworks, which in turn means that code can start using Eventlet without needing to be substantially restructured.
-
-More Hub-Related Functions
----------------------------
-
-.. autofunction:: eventlet.hubs.get_hub
-.. autofunction:: eventlet.hubs.get_default_hub
-.. autofunction:: eventlet.hubs.trampoline
-

+ 0 - 50
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/index.txt

@@ -1,50 +0,0 @@
-Eventlet Documentation
-====================================
-
-Code talks!  This is a simple web crawler that fetches a bunch of urls concurrently::
-
-    urls = ["http://www.google.com/intl/en_ALL/images/logo.gif",
-         "https://wiki.secondlife.com/w/images/secondlife.jpg",
-         "http://us.i1.yimg.com/us.yimg.com/i/ww/beta/y3.gif"]
-    
-    import eventlet
-    from eventlet.green import urllib2  
-    
-    def fetch(url):
-      return urllib2.urlopen(url).read()
-    
-    pool = eventlet.GreenPool()
-    for body in pool.imap(fetch, urls):
-      print "got body", len(body)
-
-Contents
-=========
-
-.. toctree::
-   :maxdepth: 2
-
-   basic_usage
-   design_patterns
-   patching
-   examples
-   ssl
-   threading
-   hubs
-   testing
-   environment
-
-   modules
-   
-   authors
-   history
-
-License
----------
-Eventlet is made available under the terms of the open source `MIT license <http://www.opensource.org/licenses/mit-license.php>`_
-
-Indices and tables
-==================
-
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`

+ 0 - 19
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules.txt

@@ -1,19 +0,0 @@
-Module Reference
-======================
-
-.. toctree::
-   :maxdepth: 2
-
-   modules/backdoor
-   modules/corolocal
-   modules/debug
-   modules/db_pool
-   modules/event
-   modules/greenpool
-   modules/greenthread
-   modules/pools
-   modules/queue
-   modules/semaphore
-   modules/timeout
-   modules/websocket
-   modules/wsgi

+ 0 - 27
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/backdoor.txt

@@ -1,27 +0,0 @@
-:mod:`backdoor` -- Python interactive interpreter within a running process
-===============================================================================
-
-The backdoor module is convenient for inspecting the state of a long-running process.  It supplies the normal Python interactive interpreter in a way that does not block the normal operation of the application.  This can be useful for debugging, performance tuning, or simply learning about how things behave in situ.
-
-In the application, spawn a greenthread running backdoor_server on a listening socket::
-    
-    eventlet.spawn(backdoor.backdoor_server, eventlet.listen(('localhost', 3000)))
-    
-When this is running, the backdoor is accessible via telnet to the specified port.
-
-.. code-block:: sh
-
-  $ telnet localhost 3000
-  Python 2.6.2 (r262:71600, Apr 16 2009, 09:17:39) 
-  [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
-  Type "help", "copyright", "credits" or "license" for more information.
-  >>> import myapp
-  >>> dir(myapp)
-  ['__all__', '__doc__', '__name__', 'myfunc']
-  >>>
-  
-The backdoor cooperatively yields to the rest of the application between commands, so on a running server continuously serving requests, you can observe the internal state changing between interpreter commands.
-
-.. automodule:: eventlet.backdoor
-	:members:
-

+ 0 - 6
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/corolocal.txt

@@ -1,6 +0,0 @@
-:mod:`corolocal` -- Coroutine local storage
-=============================================
-
-.. automodule:: eventlet.corolocal
-	:members:
-	:undoc-members:

+ 0 - 61
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/db_pool.txt

@@ -1,61 +0,0 @@
-:mod:`db_pool` -- DBAPI 2 database connection pooling
-========================================================
-
-The db_pool module is useful for managing database connections.  It provides three primary benefits: cooperative yielding during database operations, concurrency limiting to a database host, and connection reuse.  db_pool is intended to be database-agnostic, compatible with any DB-API 2.0 database module.
-
-*It has currently been tested and used with both MySQLdb and psycopg2.*
-
-A ConnectionPool object represents a pool of connections open to a particular database.  The arguments to the constructor include the database-software-specific module, the host name, and the credentials required for authentication.  After construction, the ConnectionPool object decides when to create and sever connections with the target database.
-
->>> import MySQLdb
->>> cp = ConnectionPool(MySQLdb, host='localhost', user='root', passwd='')
-
-Once you have this pool object, you connect to the database by calling :meth:`~eventlet.db_pool.ConnectionPool.get` on it:
-
->>> conn = cp.get()
-
-This call may either create a new connection, or reuse an existing open connection, depending on whether it has one open already or not.  You can then use the connection object as normal.  When done, you must return the connection to the pool:
-
->>> conn = cp.get()
->>> try:
-...     result = conn.cursor().execute('SELECT NOW()')
-... finally:
-...     cp.put(conn)
-
-After you've returned a connection object to the pool, it becomes useless and will raise exceptions if any of its methods are called.
-
-Constructor Arguments
-----------------------
-
-In addition to the database credentials, there are a bunch of keyword constructor arguments to the ConnectionPool that are useful.
-
-* min_size, max_size : The normal Pool arguments.  max_size is the most important constructor argument -- it determines the number of concurrent connections can be open to the destination database.  min_size is not very useful.
-* max_idle : Connections are only allowed to remain unused in the pool for a limited amount of time.  An asynchronous timer periodically wakes up and closes any connections in the pool that have been idle for longer than they are supposed to be.  Without this parameter, the pool would tend to have a 'high-water mark', where the number of connections open at a given time corresponds to the peak historical demand.  This number only has effect on the connections in the pool itself -- if you take a connection out of the pool, you can hold on to it for as long as you want.  If this is set to 0, every connection is closed upon its return to the pool.
-* max_age : The lifespan of a connection.  This works much like max_idle, but the timer is measured from the connection's creation time, and is tracked throughout the connection's life.  This means that if you take a connection out of the pool and hold on to it for some lengthy operation that exceeds max_age, upon putting the connection back in to the pool, it will be closed.  Like max_idle, max_age will not close connections that are taken out of the pool, and, if set to 0, will cause every connection to be closed when put back in the pool.
-* connect_timeout : How long to wait before raising an exception on connect().  If the database module's connect() method takes too long, it raises a ConnectTimeout exception from the get() method on the pool.
-
-DatabaseConnector
------------------
-
-If you want to connect to multiple databases easily (and who doesn't), the DatabaseConnector is for you.  It's a pool of pools, containing a ConnectionPool for every host you connect to.
-
-The constructor arguments are:
-
-* module : database module, e.g. MySQLdb.  This is simply passed through to the ConnectionPool.
-* credentials : A dictionary, or dictionary-alike, mapping hostname to connection-argument-dictionary.  This is used for the constructors of the ConnectionPool objects.  Example:
-
->>> dc = DatabaseConnector(MySQLdb,
-...      {'db.internal.example.com': {'user': 'internal', 'passwd': 's33kr1t'},
-...       'localhost': {'user': 'root', 'passwd': ''}})
-
-If the credentials contain a host named 'default', then the value for 'default' is used whenever trying to connect to a host that has no explicit entry in the database.  This is useful if there is some pool of hosts that share arguments.
-
-* conn_pool : The connection pool class to use.  Defaults to db_pool.ConnectionPool.
-
-The rest of the arguments to the DatabaseConnector constructor are passed on to the ConnectionPool.
-
-*Caveat: The DatabaseConnector is a bit unfinished, it only suits a subset of use cases.*
-
-.. automodule:: eventlet.db_pool
-	:members:
-	:undoc-members:

+ 0 - 5
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/debug.txt

@@ -1,5 +0,0 @@
-:mod:`debug` -- Debugging tools for Eventlet
-==================================================
-
-.. automodule:: eventlet.debug
-	:members:

+ 0 - 5
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/event.txt

@@ -1,5 +0,0 @@
-:mod:`event` -- Cross-greenthread primitive
-==================================================
-
-.. automodule:: eventlet.event
-	:members:

+ 0 - 6
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/greenpool.txt

@@ -1,6 +0,0 @@
-:mod:`greenpool` -- Green Thread Pools
-========================================
-
-.. automodule:: eventlet.greenpool
-	:members:
-

+ 0 - 5
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/greenthread.txt

@@ -1,5 +0,0 @@
-:mod:`greenthread` -- Green Thread Implementation
-==================================================
-
-.. automodule:: eventlet.greenthread
-	:members:

+ 0 - 5
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/pools.txt

@@ -1,5 +0,0 @@
-:mod:`pools` - Generic pools of resources 
-==========================================
-
-.. automodule:: eventlet.pools
-	:members:

+ 0 - 5
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/queue.txt

@@ -1,5 +0,0 @@
-:mod:`queue` -- Queue class
-========================================
-
-.. automodule:: eventlet.queue
-	:members:

+ 0 - 11
desktop/core/ext-py/eventlet-0.9.14/doc/_build/html/_sources/modules/semaphore.txt

@@ -1,11 +0,0 @@
-:mod:`semaphore` -- Semaphore classes
-==================================================
-
-.. autoclass:: eventlet.semaphore.Semaphore
-	:members:
-
-.. autoclass:: eventlet.semaphore.BoundedSemaphore
-	:members:
-	
-.. autoclass:: eventlet.semaphore.CappedSemaphore
-	:members:

Some files were not shown because too many files changed in this diff