Commits

schlangen  committed d669782

Renamed pygameweb to mygameweb.

  • Participants
  • Parent commits ea991c2

Comments (0)

Files changed (1197)

 *~
 */dev.db
 */localsettings.py
+*/search_index/*
 .directory
 

File mygameweb/__init__.py

Empty file added.

File mygameweb/about/authors.txt

+Authors
+=========
+
+Programming
+--------------
+Julian Habrock
+jug@fantasymail.de
+bytemuehle.de
+
+
+Design
+--------------
+Devon Scott-Tunkin
+
+
+Former Contributors
+=====================
+Orcun Avsar (Programming)

File mygameweb/about/cab-LICENSE.txt

+Copyright (c) 2007, James Bennett
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of the author nor the names of other
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

File mygameweb/about/django-profiles-LICENSE.txt

+Copyright (c) 2007, James Bennett
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of the author nor the names of other
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

File mygameweb/about/django-registration-AUTHORS.txt

+The primary author of django-registration is James Bennett
+<james@b-list.org>, who may be found online at
+<http://www.b-list.org/>.
+
+
+Others who have contributed to the application:
+
+* Samuel Adam (French translation)
+* Jannis Leidel (German translation)
+* Rapahel Hertzog (helpful suggestions on packaging and distribution)
+* Panos Laganakos (Greek translation)
+* Ilya Filippov (Russian translation)
+* Jarek Zgoda (Polish translation)
+* Meir Kriheli (Hebrew translation)
+* Italo Maia (Brazilian Portuguese translation)
+* Shinya Okano (Japanese translation)
+* A. Al-Ibrahim (Arabic translation)
+* Ernesto Rico Schmidt (Spanish translation)
+* Vladislav Mitov (Bulgarian translation)
+* Leonardo Manuel Rocha (Argentinean Spanish translation)
+* Emil Stenström (Swedish translation)
+* Liang Feng (Chinese translations)
+* Nebojsa Djordjevic (Serbian translation)
+* Nicola Larosa (Italian translation)
+* Joost Cassee (Dutch translation)
+* Björn Kristinsson (Icelandic translation)

File mygameweb/about/django-registration-LICENSE.txt

+Copyright (c) 2007-2008, James Bennett
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of the author nor the names of other
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

File mygameweb/about/install.txt

+Depdendencies
+==============
+Python_ >=2.5
+Django_ >=1.0
+PIL_
+Pygments_
+django-tagging_ >=0.3
+gdata-python-client_
+django-piston_
+pytz_
+django-timezones_
+haystack_
+
+either Solr, Whoosh or Xapian as search engine backend for haystack.
+See here_ for more information (I recomment Xapian engine).
+
+.. _Python: http://python.org/
+.. _Django: http://www.djangoproject.com/
+.. _PIL: http://www.pythonware.com/products/pil/
+.. _Pygments: http://pygments.org/
+.. _django-tagging: http://code.google.com/p/django-tagging/
+.. _gdata-python-client: http://code.google.com/p/gdata-python-client/
+.. _django-piston: http://bitbucket.org/jespern/django-piston/
+.. _pytz: http://sourceforge.net/projects/pytz/
+.. _django-timezones: http://github.com/brosner/django-timezones/
+.. _haystack: http://haystacksearch.org/
+.. _here: http://haystacksearch.org/docs/installing_search_engines.html
+
+Installation
+============
+Just add 'mygameweb' and the containing directory to your PYTHONPATH.
+Depending on your search engine you may need to edit some settings in
+settings.py (see here_ again).
+
+Run
+===
+
+local development server
+---------------------------
+
+  $ cd mygameweb
+  $ python manage.py syncdb 
+    > create superuser? "no"
+  $ python manage.py generatecss
+  $ python manage.py loaddata fixtures/initial_data.json
+  $ python manage.py ipsum
+  $ python manage.py runserver
+  
+Go to mygameweb, delete dev.db, update the database, generate pygments
+themes for code highlighting, load some initial testing content
+if you like and start Django's devserver.
+
+Deployment
+-----------
+Edit settings.py and set up your database like above. Then have a look into 
+the documentation_ to see how to get Django running on your server with your
+choice of deployment.
+
+.._documentation: http://docs.djangoproject.com/en/dev/howto/deployment/#howto-deployment-index

File mygameweb/about/license.txt

+Copyright (c) 2009, Julian Habrock <jug@fantasymail.de> and 
+Devon Scott-Tunkin <djvonfunkin@yahoo.com>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of the author nor the names of other
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

File mygameweb/api/__init__.py

Empty file added.

File mygameweb/api/handlers.py

+from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
+from django.contrib.sites.models import Site
+from django.forms import model_to_dict
+from django.shortcuts import render_to_response
+from django.template import RequestContext
+
+from piston.handler import BaseHandler, AnonymousBaseHandler
+from piston.utils import rc, validate, throttle
+from piston.forms import ModelForm
+from piston.doc import generate_doc
+
+from projects.models import Project, Release
+from projects.forms import ProjectCreationForm, ProjectEditForm
+from projects.forms import ReleaseCreationForm, ReleaseEditForm
+
+class GenericDisplay:
+    @classmethod
+    def url(self, object):
+        return "http://%s%s" % (Site.objects.get_current(),
+                                object.get_absolute_url())
+    
+    @classmethod
+    def markup(self, object):
+        return object.get_markup_display()
+    
+    @classmethod
+    def creator(self, object):
+        return object.creator.username
+    
+    @classmethod
+    def last_editor(self, object):
+        return object.last_editor.username
+    
+    
+class ProjectDisplay(GenericDisplay):    
+    @classmethod
+    def members(self, project):
+        return ", ".join([member.username for member in project.members.all()])
+    
+    @classmethod
+    def admins(self, project):
+        return ", ".join([admin.username for admin in project.admins.all()])
+    
+    @classmethod
+    def comments(self, project):
+        return project.comment_count
+    
+    @classmethod
+    def newest_version(self, project):
+        if project.release_set.count():
+            return project.release_set.all()[0].version
+        else:
+            return "no release yet"
+    
+class ReleaseDisplay(GenericDisplay):
+    @classmethod
+    def project(self, release):
+        return release.project.name
+    
+
+class AnonymousProjectHandler(ProjectDisplay, AnonymousBaseHandler):
+    model = Project
+    allowed_methods = ["GET"]
+    fields = ['name', 'summary', 'description', 
+              #'raw_description', 'raw_summary', 'slug',
+              
+              'is_inactive', 'hide', 'created', 'last_edited',
+              'comments', 'markup', 'admins',
+              'members', 'url', 'homepage_link', 
+              'creator', 'last_editor', 'newest_version']
+    
+    def read(self, request, slug):              
+        """
+        get a project
+        """
+        try:
+            p = Project.objects.get(slug=slug, is_inactive=False)
+        except ObjectDoesNotExist:
+            return rc.NOT_FOUND
+        except MultipleObjectsReturned: # should never happen, since we're using a PK
+            return rc.BAD_REQUEST
+        else:
+            return p              
+
+class ProjectHandler(ProjectDisplay, BaseHandler):
+    allowed_methods = ['GET', 'PUT', 'POST', 'DELETE']
+    model = Project
+    anonymous = AnonymousProjectHandler
+    fields = ['name', 'summary', 'description', 
+              #'raw_description', 'raw_summary', 'slug',
+              
+              'is_inactive', 'hide', 'created', 'last_edited',
+              'comments', 'markup', 'admins',
+              'members', 'url', 'homepage_link', 
+              'creator', 'last_editor', 'newest_version']
+