diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..78abbc8e --- /dev/null +++ b/LICENSE @@ -0,0 +1,14 @@ +2009 (c) BenoƮt Chesneau +2009 (c) Paul J. Davis + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/Manifest.in b/Manifest.in new file mode 100644 index 00000000..c43a84d9 --- /dev/null +++ b/Manifest.in @@ -0,0 +1,3 @@ +include LICENSE +include README.txt +include README.md \ No newline at end of file diff --git a/README.txt b/README.txt new file mode 100644 index 00000000..ae929f6f --- /dev/null +++ b/README.txt @@ -0,0 +1,2 @@ +gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and nothing else. +This is a port of Unicorn (http://unicorn.bogomips.org/) in Python. \ No newline at end of file diff --git a/bin/gunicorn b/bin/gunicorn index 70a23893..7d45be40 100755 --- a/bin/gunicorn +++ b/bin/gunicorn @@ -1,4 +1,20 @@ #! /usr/bin/env python +# -*- coding: utf-8 - +# +# 2009 (c) Benoit Chesneau +# 2009 (c) Paul J. Davis +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. import optparse as op import os diff --git a/test.py b/examples/test.py similarity index 93% rename from test.py rename to examples/test.py index 1d242986..6d974dd6 100644 --- a/test.py +++ b/examples/test.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 - def app(environ, start_response): """Simplest possible application object""" diff --git a/gunicorn.egg-info/PKG-INFO b/gunicorn.egg-info/PKG-INFO new file mode 100644 index 00000000..356c8a2a --- /dev/null +++ b/gunicorn.egg-info/PKG-INFO @@ -0,0 +1,20 @@ +Metadata-Version: 1.0 +Name: gunicorn +Version: 0.1 +Summary: WSGI HTTP Server for UNIX +Home-page: http://github.com/benoitc/gunicorn +Author: Benoit Chesneau +Author-email: benoitc@e-engura.com +License: Apache License 2 +Description: gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and nothing else. + This is a port of Unicorn (http://unicorn.bogomips.org/) in Python. +Platform: UNKNOWN +Classifier: Development Status :: 4 - Beta +Classifier: Environment :: Other Environment +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Operating System :: POSIX +Classifier: Programming Language :: Python +Classifier: Topic :: Internet,Topic :: Utilities +Classifier: Topic :: Software Development :: Libraries :: Python Modules diff --git a/gunicorn.egg-info/SOURCES.txt b/gunicorn.egg-info/SOURCES.txt new file mode 100644 index 00000000..9a0d9bf0 --- /dev/null +++ b/gunicorn.egg-info/SOURCES.txt @@ -0,0 +1,18 @@ +LICENSE +MANIFEST.in +README.md +README.txt +setup.py +bin/gunicorn +gunicorn/__init__.py +gunicorn/arbiter.py +gunicorn/util.py +gunicorn/worker.py +gunicorn.egg-info/PKG-INFO +gunicorn.egg-info/SOURCES.txt +gunicorn.egg-info/dependency_links.txt +gunicorn.egg-info/top_level.txt +gunicorn/http/__init__.py +gunicorn/http/iostream.py +gunicorn/http/request.py +gunicorn/http/response.py \ No newline at end of file diff --git a/gunicorn.egg-info/dependency_links.txt b/gunicorn.egg-info/dependency_links.txt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/gunicorn.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/gunicorn.egg-info/top_level.txt b/gunicorn.egg-info/top_level.txt new file mode 100644 index 00000000..8f22dccf --- /dev/null +++ b/gunicorn.egg-info/top_level.txt @@ -0,0 +1 @@ +gunicorn diff --git a/gunicorn/__init__.py b/gunicorn/__init__.py index fa867849..5db1169d 100644 --- a/gunicorn/__init__.py +++ b/gunicorn/__init__.py @@ -1,19 +1,19 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 - # -# Copyright 2008,2009 Benoit Chesneau +# 2009 (c) Benoit Chesneau +# 2009 (c) Paul J. Davis # -# 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# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. # -# 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. - +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. __version__ = "0.1" diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py index fce66387..860b5033 100644 --- a/gunicorn/arbiter.py +++ b/gunicorn/arbiter.py @@ -1,3 +1,20 @@ +# -*- coding: utf-8 - +# +# 2009 (c) Benoit Chesneau +# 2009 (c) Paul J. Davis +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + import errno import fcntl import logging diff --git a/gunicorn/http/__init__.py b/gunicorn/http/__init__.py index 0781c783..e2e5826a 100644 --- a/gunicorn/http/__init__.py +++ b/gunicorn/http/__init__.py @@ -1,3 +1,19 @@ +# -*- coding: utf-8 - +# +# 2009 (c) Benoit Chesneau +# 2009 (c) Paul J. Davis +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. from request import HTTPRequest from response import HTTPResponse \ No newline at end of file diff --git a/gunicorn/http/iostream.py b/gunicorn/http/iostream.py index 89db5f9b..64814138 100644 --- a/gunicorn/http/iostream.py +++ b/gunicorn/http/iostream.py @@ -1,18 +1,21 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 - # -# Copyright 2008,2009 Benoit Chesneau +# 2009 (c) Benoit Chesneau +# 2009 (c) Paul J. Davis # -# 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# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. # -# 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. +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \ ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, errorcode diff --git a/gunicorn/http/request.py b/gunicorn/http/request.py index b62b2d0e..0d792bca 100644 --- a/gunicorn/http/request.py +++ b/gunicorn/http/request.py @@ -1,18 +1,20 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 - # -# Copyright 2008,2009 Benoit Chesneau +# 2009 (c) Benoit Chesneau +# 2009 (c) Paul J. Davis # -# 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# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. # -# 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. +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + import re import StringIO @@ -72,8 +74,7 @@ class HTTPRequest(object): length, wsgi_input = self.decode_chunked() else: wsgi_input = FileInput(self) - - + environ = { "wsgi.url_scheme": 'http', "wsgi.input": wsgi_input, diff --git a/gunicorn/http/response.py b/gunicorn/http/response.py index 04eea89a..d05a3311 100644 --- a/gunicorn/http/response.py +++ b/gunicorn/http/response.py @@ -1,18 +1,20 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 - # -# Copyright 2008,2009 Benoit Chesneau +# 2009 (c) Benoit Chesneau +# 2009 (c) Paul J. Davis # -# 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# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. # -# 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. +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + class HTTPResponse(object): diff --git a/gunicorn/util.py b/gunicorn/util.py index 704f29fb..75f06ffc 100644 --- a/gunicorn/util.py +++ b/gunicorn/util.py @@ -1,3 +1,19 @@ +# -*- coding: utf-8 - +# +# 2009 (c) Benoit Chesneau +# 2009 (c) Paul J. Davis +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. def import_app(module): parts = module.rsplit(":", 1) diff --git a/gunicorn/worker.py b/gunicorn/worker.py index 521925ba..f66a8e81 100644 --- a/gunicorn/worker.py +++ b/gunicorn/worker.py @@ -1,3 +1,19 @@ +# -*- coding: utf-8 - +# +# 2009 (c) Benoit Chesneau +# 2009 (c) Paul J. Davis +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. import errno import logging diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..84c1b00f --- /dev/null +++ b/setup.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python +# -*- coding: utf-8 - +# +# Copyright (c) 2009 Benoit Chesneau +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +import os +from setuptools import setup, find_packages + +setup( + name = 'gunicorn', + version = '0.1', + + description = 'WSGI HTTP Server for UNIX', + long_description = file( + os.path.join( + os.path.dirname(__file__), + 'README.txt' + ) + ).read(), + author = 'Benoit Chesneau', + author_email = 'benoitc@e-engura.com', + license = 'Apache License 2', + url = 'http://github.com/benoitc/gunicorn', + + classifiers = [ + 'Development Status :: 4 - Beta', + 'Environment :: Other Environment', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Operating System :: MacOS :: MacOS X', + 'Operating System :: POSIX', + 'Programming Language :: Python', + 'Topic :: Internet,' + 'Topic :: Utilities', + 'Topic :: Software Development :: Libraries :: Python Modules', + ], + + packages = find_packages(), + include_package_data = True, + scripts = ['bin/gunicorn'], + +) +