Permalink
Browse files

Added proper structure

  • Loading branch information...
1 parent d153481 commit f13cdf62b1f48900bbd7850d0ea5f331eb5d5302 Ask Solem committed with Ask Solem Hoel Mar 17, 2009
View
@@ -0,0 +1,12 @@
+.DS_Store
+*.pyc
+*~
+*.sqlite
+*.sqlite-journal
+settings_local.py
+.*.sw[po]
+dist/
+*.egg-info
+doc/__build/*
+pip-log.txt
+devdatabase.db
View
@@ -0,0 +1 @@
+Ask Solem <askh@opera.com>
View
@@ -0,0 +1,28 @@
+Copyright (c) 2009, Ask Solem
+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 Ask Solem nor the names of its 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.
+
View
@@ -0,0 +1,5 @@
+include AUTHORS
+include README
+include TODO
+include MANIFEST.in
+recursive-include manifest *
View
@@ -0,0 +1,30 @@
+=========================================
+ChiShop/DjangoPyPI
+=========================================
+:Version: 0.1
+:Authors:
+ Ask Solem (askh@opera.com)
+
+Installation
+============
+
+First you have to install the dependencies::
+
+ $ python setup.py build
+ # python setup.py install # (run as root)
+
+Initial configuration
+---------------------
+
+ $ python manage.py syncdb
+
+Run the PyPI server
+-------------------
+
+ $ python manage.py runserver
+
+Contact Information
+====================
+askh@opera.com
+
+.. # vim: syntax=rst expandtab tabstop=4 shiftwidth=4 shiftround
View
0 media/foo.txt → TODO 100755 → 100644
File renamed without changes.
View
@@ -0,0 +1,33 @@
+""" chishop.py
+Copyright (c) 2009, Ask Solem
+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 Ask Solem nor the names of its 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.
+
+"""
+
+VERSION = (0, 1, 0)
+__version__ = ".".join(map(str, VERSION))
File renamed without changes.
@@ -0,0 +1,38 @@
+""" admin.py
+
+Copyright (c) 2009, Ask Solem
+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 Ask Solem nor the names of its 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.
+
+"""
+
+from django.contrib import admin
+from djangopypi.models import Project, Release, Classifier
+
+admin.site.register(Project)
+admin.site.register(Release)
+admin.site.register(Classifier)
@@ -0,0 +1,63 @@
+""" forms.py
+
+Copyright (c) 2009, Ask Solem
+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 Ask Solem nor the names of its 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.
+
+"""
+
+from django import forms
+from djangopypi.models import Project, Classifier, Release
+
+
+class ProjectRegisterForm(forms.Form):
+ name = forms.CharField()
+ license = forms.CharField(required=False)
+ metadata_version = forms.CharField(initial="1.0")
+ author = forms.CharField(required=False)
+ home_page = forms.CharField(required=False)
+ download_url = forms.CharField(required=False)
+ summary = forms.CharField(required=False)
+ description = forms.CharField(required=False)
+ author_email = forms.CharField(required=False)
+ version = forms.CharField()
+ platform = forms.CharField(required=False)
+
+ def save(self, classifiers, file=None):
+ values = dict(self.cleaned_data)
+ name = values.pop("name")
+ version = values.pop("version")
+ platform = values.pop("platform")
+ project, c = Project.objects.get_or_create(name=name, defaults=values)
+ for classifier in classifiers:
+ project.classifiers.add(
+ Classifier.objects.get_or_create(name=classifier)[0])
+ release, c = Release.objects.get_or_create(version=version,
+ platform=platform, project=project)
+ if file:
+ release.distribution.save(file.name, file, save=True)
+ release.save()
@@ -1,3 +1,35 @@
+""" models.py
+
+Copyright (c) 2009, Ask Solem
+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 Ask Solem nor the names of its 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.
+
+"""
+
import os
from django.db import models
from django.utils.translation import ugettext_lazy as _
@@ -30,6 +62,7 @@
("ultrasparc", "UltraSparc"),
)
+
class Classifier(models.Model):
name = models.CharField(max_length=255, unique=True)
@@ -40,6 +73,7 @@ class Meta:
def __unicode__(self):
return self.name
+
class Project(models.Model):
name = models.CharField(max_length=255, unique=True)
license = models.CharField(max_length=255, blank=True)
@@ -59,6 +93,7 @@ class Meta:
def __unicode__(self):
return self.name
+
class Release(models.Model):
version = models.CharField(max_length=128)
distribution = models.FileField(upload_to="dists")
@@ -82,4 +117,3 @@ def filename(self):
@property
def path(self):
return self.distribution.name
-
@@ -1,4 +1,35 @@
-# Create your views here.
+""" views.py
+
+Copyright (c) 2009, Ask Solem
+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 Ask Solem nor the names of its 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.
+
+"""
+
from django.http import HttpResponse, HttpResponseBadRequest, QueryDict
from django.shortcuts import render_to_response
from djangopypi.models import Project
File renamed without changes.
File renamed without changes.
View
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -1,5 +0,0 @@
-from django.contrib import admin
-from djangopypi.models import Project, Release
-
-admin.site.register(Project)
-admin.site.register(Release)
View
@@ -1,35 +0,0 @@
-from django import forms
-from djangopypi.models import Project, Classifier, Release
-
-class ProjectRegisterForm(forms.Form):
- name = forms.CharField()
- license = forms.CharField(required=False)
- metadata_version = forms.CharField(initial="1.0")
- author = forms.CharField(required=False)
- home_page = forms.CharField(required=False)
- download_url = forms.CharField(required=False)
- summary = forms.CharField(required=False)
- description = forms.CharField(required=False)
- author_email = forms.CharField(required=False)
- version = forms.CharField()
- platform = forms.CharField(required=False)
-
- def save(self, classifiers, file=None):
- values = dict(self.cleaned_data)
- name = values.pop("name")
- version = values.pop("version")
- platform = values.pop("platform")
- project, c = Project.objects.get_or_create(name=name, defaults=values)
- for classifier in classifiers:
- project.classifiers.add(
- Classifier.objects.get_or_create(name=classifier)[0])
- release, c = Release.objects.get_or_create(version=version,
- platform=platform, project=project)
- if file:
- release.distribution.save(file.name, file, save=True)
- release.save()
-
-
-
-
-
View
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+import os
+import codecs
+
+try:
+ from setuptools import setup, find_packages
+except ImportError:
+ from ez_setup import use_setuptools
+ use_setuptools()
+ from setuptools import setup, find_packages
+
+setup(
+ name='chishop',
+ version=__import__('chishop').__version__,
+ description='Simple PyPI server written in Django.',
+ author='Ask Solem',
+ author_email='askh@opera.com',
+ packages=[],
+ install_requires=[
+ 'django>=1.0',
+ ],
+ classifiers=[
+ "Development Status :: 3 - Alpha",
+ "Environment :: Web Environment",
+ "Framework :: Django",
+ "Operating System :: OS Independent",
+ "Intended Audience :: Developers",
+ "Intended Audience :: System Administrators",
+ "License :: OSI Approved :: BSD License",
+ "Programming Language :: Python",
+ ],
+ long_description=codecs.open('README', "r", "utf-8").read(),
+)

0 comments on commit f13cdf6

Please sign in to comment.