diff options
author | Ask Solem <askh@modwheel.net> | 2009-03-17 11:02:56 +0100 |
---|---|---|
committer | Ask Solem Hoel <askh@opera.com> | 2009-03-17 11:02:56 +0100 |
commit | f13cdf62b1f48900bbd7850d0ea5f331eb5d5302 (patch) | |
tree | 72523852555a00509d37f4e12e3562a0a9ae1af7 | |
parent | d153481657e6e4b05ffe2641dd364005b0787da1 (diff) | |
download | chishop-f13cdf62b1f48900bbd7850d0ea5f331eb5d5302.tar.bz2 chishop-f13cdf62b1f48900bbd7850d0ea5f331eb5d5302.tar.xz chishop-f13cdf62b1f48900bbd7850d0ea5f331eb5d5302.zip |
Added proper structure
-rw-r--r-- | .gitignore | 12 | ||||
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | LICENSE | 28 | ||||
-rw-r--r-- | MANIFEST.in | 5 | ||||
-rw-r--r-- | README | 30 | ||||
-rw-r--r-- | TODO (renamed from __init__.py) | 0 | ||||
-rw-r--r-- | chishop/__init__.py | 33 | ||||
-rw-r--r-- | chishop/djangopypi/__init__.py (renamed from djangopypi/__init__.py) | 0 | ||||
-rw-r--r-- | chishop/djangopypi/admin.py | 38 | ||||
-rw-r--r-- | chishop/djangopypi/forms.py | 63 | ||||
-rw-r--r-- | chishop/djangopypi/models.py (renamed from djangopypi/models.py) | 36 | ||||
-rw-r--r-- | chishop/djangopypi/templates/djangopypi/show_links.html (renamed from djangopypi/templates/djangopypi/show_links.html) | 0 | ||||
-rw-r--r-- | chishop/djangopypi/templates/djangopypi/show_version.html (renamed from djangopypi/templates/djangopypi/show_version.html) | 0 | ||||
-rw-r--r-- | chishop/djangopypi/templates/djangopypi/simple.html (renamed from djangopypi/templates/djangopypi/simple.html) | 0 | ||||
-rw-r--r-- | chishop/djangopypi/views.py (renamed from djangopypi/views.py) | 33 | ||||
-rw-r--r-- | chishop/manage.py (renamed from manage.py) | 0 | ||||
-rwxr-xr-x | chishop/media/_ (renamed from media/_) | 0 | ||||
-rwxr-xr-x | chishop/media/dists/django-greystripe-0.1.tar.gz (renamed from media/dists/django-greystripe-0.1.tar.gz) | bin | 4653 -> 4653 bytes | |||
-rwxr-xr-x | chishop/media/foo.txt (renamed from media/foo.txt) | 0 | ||||
-rw-r--r-- | chishop/settings.py (renamed from settings.py) | 0 | ||||
-rw-r--r-- | chishop/urls.py (renamed from urls.py) | 0 | ||||
-rw-r--r-- | djangopypi/admin.py | 5 | ||||
-rw-r--r-- | djangopypi/forms.py | 35 | ||||
-rw-r--r-- | setup.py | 34 |
24 files changed, 311 insertions, 42 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2e00023 --- /dev/null +++ b/.gitignore | |||
@@ -0,0 +1,12 @@ | |||
1 | .DS_Store | ||
2 | *.pyc | ||
3 | *~ | ||
4 | *.sqlite | ||
5 | *.sqlite-journal | ||
6 | settings_local.py | ||
7 | .*.sw[po] | ||
8 | dist/ | ||
9 | *.egg-info | ||
10 | doc/__build/* | ||
11 | pip-log.txt | ||
12 | devdatabase.db | ||
@@ -0,0 +1 @@ | |||
Ask Solem <askh@opera.com> | |||
@@ -0,0 +1,28 @@ | |||
1 | Copyright (c) 2009, Ask Solem | ||
2 | All rights reserved. | ||
3 | |||
4 | Redistribution and use in source and binary forms, with or without | ||
5 | modification, are permitted provided that the following conditions are met: | ||
6 | |||
7 | * Redistributions of source code must retain the above copyright notice, | ||
8 | this list of conditions and the following disclaimer. | ||
9 | * Redistributions in binary form must reproduce the above copyright | ||
10 | notice, this list of conditions and the following disclaimer in the | ||
11 | documentation and/or other materials provided with the distribution. | ||
12 | |||
13 | Neither the name of Ask Solem nor the names of its contributors may be used | ||
14 | to endorse or promote products derived from this software without specific | ||
15 | prior written permission. | ||
16 | |||
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
19 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
20 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS | ||
21 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
22 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
23 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
24 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
25 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
26 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
27 | POSSIBILITY OF SUCH DAMAGE. | ||
28 | |||
diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..45e2f40 --- /dev/null +++ b/MANIFEST.in | |||
@@ -0,0 +1,5 @@ | |||
1 | include AUTHORS | ||
2 | include README | ||
3 | include TODO | ||
4 | include MANIFEST.in | ||
5 | recursive-include manifest * | ||
@@ -0,0 +1,30 @@ | |||
1 | ========================================= | ||
2 | ChiShop/DjangoPyPI | ||
3 | ========================================= | ||
4 | :Version: 0.1 | ||
5 | :Authors: | ||
6 | Ask Solem (askh@opera.com) | ||
7 | |||
8 | Installation | ||
9 | ============ | ||
10 | |||
11 | First you have to install the dependencies:: | ||
12 | |||
13 | $ python setup.py build | ||
14 | # python setup.py install # (run as root) | ||
15 | |||
16 | Initial configuration | ||
17 | --------------------- | ||
18 | |||
19 | $ python manage.py syncdb | ||
20 | |||
21 | Run the PyPI server | ||
22 | ------------------- | ||
23 | |||
24 | $ python manage.py runserver | ||
25 | |||
26 | Contact Information | ||
27 | ==================== | ||
28 | askh@opera.com | ||
29 | |||
30 | .. # vim: syntax=rst expandtab tabstop=4 shiftwidth=4 shiftround | ||
diff --git a/chishop/__init__.py b/chishop/__init__.py new file mode 100644 index 0000000..33c912b --- /dev/null +++ b/chishop/__init__.py | |||
@@ -0,0 +1,33 @@ | |||
1 | """ chishop.py | ||
2 | Copyright (c) 2009, Ask Solem | ||
3 | All rights reserved. | ||
4 | |||
5 | Redistribution and use in source and binary forms, with or without | ||
6 | modification, are permitted provided that the following conditions are met: | ||
7 | |||
8 | * Redistributions of source code must retain the above copyright notice, | ||
9 | this list of conditions and the following disclaimer. | ||
10 | * Redistributions in binary form must reproduce the above copyright | ||
11 | notice, this list of conditions and the following disclaimer in the | ||
12 | documentation and/or other materials provided with the distribution. | ||
13 | |||
14 | Neither the name of Ask Solem nor the names of its contributors may be used | ||
15 | to endorse or promote products derived from this software without specific | ||
16 | prior written permission. | ||
17 | |||
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
20 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
21 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS | ||
22 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
28 | POSSIBILITY OF SUCH DAMAGE. | ||
29 | |||
30 | """ | ||
31 | |||
32 | VERSION = (0, 1, 0) | ||
33 | __version__ = ".".join(map(str, VERSION)) | ||
diff --git a/djangopypi/__init__.py b/chishop/djangopypi/__init__.py index e69de29..e69de29 100644 --- a/djangopypi/__init__.py +++ b/chishop/djangopypi/__init__.py | |||
diff --git a/chishop/djangopypi/admin.py b/chishop/djangopypi/admin.py new file mode 100644 index 0000000..30290e0 --- /dev/null +++ b/chishop/djangopypi/admin.py | |||
@@ -0,0 +1,38 @@ | |||
1 | """ admin.py | ||
2 | |||
3 | Copyright (c) 2009, Ask Solem | ||
4 | All rights reserved. | ||
5 | |||
6 | Redistribution and use in source and binary forms, with or without | ||
7 | modification, are permitted provided that the following conditions are met: | ||
8 | |||
9 | * Redistributions of source code must retain the above copyright notice, | ||
10 | this list of conditions and the following disclaimer. | ||
11 | * Redistributions in binary form must reproduce the above copyright | ||
12 | notice, this list of conditions and the following disclaimer in the | ||
13 | documentation and/or other materials provided with the distribution. | ||
14 | |||
15 | Neither the name of Ask Solem nor the names of its contributors may be used | ||
16 | to endorse or promote products derived from this software without specific | ||
17 | prior written permission. | ||
18 | |||
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
22 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS | ||
23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
29 | POSSIBILITY OF SUCH DAMAGE. | ||
30 | |||
31 | """ | ||
32 | |||
33 | from django.contrib import admin | ||
34 | from djangopypi.models import Project, Release, Classifier | ||
35 | |||
36 | admin.site.register(Project) | ||
37 | admin.site.register(Release) | ||
38 | admin.site.register(Classifier) | ||
diff --git a/chishop/djangopypi/forms.py b/chishop/djangopypi/forms.py new file mode 100644 index 0000000..1cf9a9d --- /dev/null +++ b/chishop/djangopypi/forms.py | |||
@@ -0,0 +1,63 @@ | |||
1 | """ forms.py | ||
2 | |||
3 | Copyright (c) 2009, Ask Solem | ||
4 | All rights reserved. | ||
5 | |||
6 | Redistribution and use in source and binary forms, with or without | ||
7 | modification, are permitted provided that the following conditions are met: | ||
8 | |||
9 | * Redistributions of source code must retain the above copyright notice, | ||
10 | this list of conditions and the following disclaimer. | ||
11 | * Redistributions in binary form must reproduce the above copyright | ||
12 | notice, this list of conditions and the following disclaimer in the | ||
13 | documentation and/or other materials provided with the distribution. | ||
14 | |||
15 | Neither the name of Ask Solem nor the names of its contributors may be used | ||
16 | to endorse or promote products derived from this software without specific | ||
17 | prior written permission. | ||
18 | |||
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
22 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS | ||
23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
29 | POSSIBILITY OF SUCH DAMAGE. | ||
30 | |||
31 | """ | ||
32 | |||
33 | from django import forms | ||
34 | from djangopypi.models import Project, Classifier, Release | ||
35 | |||
36 | |||
37 | class ProjectRegisterForm(forms.Form): | ||
38 | name = forms.CharField() | ||
39 | license = forms.CharField(required=False) | ||
40 | metadata_version = forms.CharField(initial="1.0") | ||
41 | author = forms.CharField(required=False) | ||
42 | home_page = forms.CharField(required=False) | ||
43 | download_url = forms.CharField(required=False) | ||
44 | summary = forms.CharField(required=False) | ||
45 | description = forms.CharField(required=False) | ||
46 | author_email = forms.CharField(required=False) | ||
47 | version = forms.CharField() | ||
48 | platform = forms.CharField(required=False) | ||
49 | |||
50 | def save(self, classifiers, file=None): | ||
51 | values = dict(self.cleaned_data) | ||
52 | name = values.pop("name") | ||
53 | version = values.pop("version") | ||
54 | platform = values.pop("platform") | ||
55 | project, c = Project.objects.get_or_create(name=name, defaults=values) | ||
56 | for classifier in classifiers: | ||
57 | project.classifiers.add( | ||
58 | Classifier.objects.get_or_create(name=classifier)[0]) | ||
59 | release, c = Release.objects.get_or_create(version=version, | ||
60 | platform=platform, project=project) | ||
61 | if file: | ||
62 | release.distribution.save(file.name, file, save=True) | ||
63 | release.save() | ||
diff --git a/djangopypi/models.py b/chishop/djangopypi/models.py index 34276a5..d66f5c8 100644 --- a/djangopypi/models.py +++ b/chishop/djangopypi/models.py | |||
@@ -1,3 +1,35 @@ | |||
1 | """ models.py | ||
2 | |||
3 | Copyright (c) 2009, Ask Solem | ||
4 | All rights reserved. | ||
5 | |||
6 | Redistribution and use in source and binary forms, with or without | ||
7 | modification, are permitted provided that the following conditions are met: | ||
8 | |||
9 | * Redistributions of source code must retain the above copyright notice, | ||
10 | this list of conditions and the following disclaimer. | ||
11 | * Redistributions in binary form must reproduce the above copyright | ||
12 | notice, this list of conditions and the following disclaimer in the | ||
13 | documentation and/or other materials provided with the distribution. | ||
14 | |||
15 | Neither the name of Ask Solem nor the names of its contributors may be used | ||
16 | to endorse or promote products derived from this software without specific | ||
17 | prior written permission. | ||
18 | |||
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
22 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS | ||
23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
29 | POSSIBILITY OF SUCH DAMAGE. | ||
30 | |||
31 | """ | ||
32 | |||
1 | import os | 33 | import os |
2 | from django.db import models | 34 | from django.db import models |
3 | from django.utils.translation import ugettext_lazy as _ | 35 | from django.utils.translation import ugettext_lazy as _ |
@@ -30,6 +62,7 @@ ARCHITECTURES = ( | |||
30 | ("ultrasparc", "UltraSparc"), | 62 | ("ultrasparc", "UltraSparc"), |
31 | ) | 63 | ) |
32 | 64 | ||
65 | |||
33 | class Classifier(models.Model): | 66 | class Classifier(models.Model): |
34 | name = models.CharField(max_length=255, unique=True) | 67 | name = models.CharField(max_length=255, unique=True) |
35 | 68 | ||
@@ -40,6 +73,7 @@ class Classifier(models.Model): | |||
40 | def __unicode__(self): | 73 | def __unicode__(self): |
41 | return self.name | 74 | return self.name |
42 | 75 | ||
76 | |||
43 | class Project(models.Model): | 77 | class Project(models.Model): |
44 | name = models.CharField(max_length=255, unique=True) | 78 | name = models.CharField(max_length=255, unique=True) |
45 | license = models.CharField(max_length=255, blank=True) | 79 | license = models.CharField(max_length=255, blank=True) |
@@ -59,6 +93,7 @@ class Project(models.Model): | |||
59 | def __unicode__(self): | 93 | def __unicode__(self): |
60 | return self.name | 94 | return self.name |
61 | 95 | ||
96 | |||
62 | class Release(models.Model): | 97 | class Release(models.Model): |
63 | version = models.CharField(max_length=128) | 98 | version = models.CharField(max_length=128) |
64 | distribution = models.FileField(upload_to="dists") | 99 | distribution = models.FileField(upload_to="dists") |
@@ -82,4 +117,3 @@ class Release(models.Model): | |||
82 | @property | 117 | @property |
83 | def path(self): | 118 | def path(self): |
84 | return self.distribution.name | 119 | return self.distribution.name |
85 | |||
diff --git a/djangopypi/templates/djangopypi/show_links.html b/chishop/djangopypi/templates/djangopypi/show_links.html index b805f47..b805f47 100644 --- a/djangopypi/templates/djangopypi/show_links.html +++ b/chishop/djangopypi/templates/djangopypi/show_links.html | |||
diff --git a/djangopypi/templates/djangopypi/show_version.html b/chishop/djangopypi/templates/djangopypi/show_version.html index f0c9d75..f0c9d75 100644 --- a/djangopypi/templates/djangopypi/show_version.html +++ b/chishop/djangopypi/templates/djangopypi/show_version.html | |||
diff --git a/djangopypi/templates/djangopypi/simple.html b/chishop/djangopypi/templates/djangopypi/simple.html index de761a5..de761a5 100644 --- a/djangopypi/templates/djangopypi/simple.html +++ b/chishop/djangopypi/templates/djangopypi/simple.html | |||
diff --git a/djangopypi/views.py b/chishop/djangopypi/views.py index 7136dda..fc4061d 100644 --- a/djangopypi/views.py +++ b/chishop/djangopypi/views.py | |||
@@ -1,4 +1,35 @@ | |||
1 | # Create your views here. | 1 | """ views.py |
2 | |||
3 | Copyright (c) 2009, Ask Solem | ||
4 | All rights reserved. | ||
5 | |||
6 | Redistribution and use in source and binary forms, with or without | ||
7 | modification, are permitted provided that the following conditions are met: | ||
8 | |||
9 | * Redistributions of source code must retain the above copyright notice, | ||
10 | this list of conditions and the following disclaimer. | ||
11 | * Redistributions in binary form must reproduce the above copyright | ||
12 | notice, this list of conditions and the following disclaimer in the | ||
13 | documentation and/or other materials provided with the distribution. | ||
14 | |||
15 | Neither the name of Ask Solem nor the names of its contributors may be used | ||
16 | to endorse or promote products derived from this software without specific | ||
17 | prior written permission. | ||
18 | |||
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
22 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS | ||
23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
29 | POSSIBILITY OF SUCH DAMAGE. | ||
30 | |||
31 | """ | ||
32 | |||
2 | from django.http import HttpResponse, HttpResponseBadRequest, QueryDict | 33 | from django.http import HttpResponse, HttpResponseBadRequest, QueryDict |
3 | from django.shortcuts import render_to_response | 34 | from django.shortcuts import render_to_response |
4 | from djangopypi.models import Project | 35 | from djangopypi.models import Project |
diff --git a/manage.py b/chishop/manage.py index 5e78ea9..5e78ea9 100644 --- a/manage.py +++ b/chishop/manage.py | |||
diff --git a/media/_ b/chishop/media/_ index e69de29..e69de29 100755 --- a/media/_ +++ b/chishop/media/_ | |||
diff --git a/media/dists/django-greystripe-0.1.tar.gz b/chishop/media/dists/django-greystripe-0.1.tar.gz index bef3dd7..bef3dd7 100755 --- a/media/dists/django-greystripe-0.1.tar.gz +++ b/chishop/media/dists/django-greystripe-0.1.tar.gz | |||
Binary files differ | |||
diff --git a/media/foo.txt b/chishop/media/foo.txt index e69de29..e69de29 100755 --- a/media/foo.txt +++ b/chishop/media/foo.txt | |||
diff --git a/settings.py b/chishop/settings.py index 8c18760..8c18760 100644 --- a/settings.py +++ b/chishop/settings.py | |||
diff --git a/urls.py b/chishop/urls.py index f6709f8..f6709f8 100644 --- a/urls.py +++ b/chishop/urls.py | |||
diff --git a/djangopypi/admin.py b/djangopypi/admin.py deleted file mode 100644 index 6e20fd3..0000000 --- a/djangopypi/admin.py +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | from django.contrib import admin | ||
2 | from djangopypi.models import Project, Release | ||
3 | |||
4 | admin.site.register(Project) | ||
5 | admin.site.register(Release) | ||
diff --git a/djangopypi/forms.py b/djangopypi/forms.py deleted file mode 100644 index 922301b..0000000 --- a/djangopypi/forms.py +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | from django import forms | ||
2 | from djangopypi.models import Project, Classifier, Release | ||
3 | |||
4 | class ProjectRegisterForm(forms.Form): | ||
5 | name = forms.CharField() | ||
6 | license = forms.CharField(required=False) | ||
7 | metadata_version = forms.CharField(initial="1.0") | ||
8 | author = forms.CharField(required=False) | ||
9 | home_page = forms.CharField(required=False) | ||
10 | download_url = forms.CharField(required=False) | ||
11 | summary = forms.CharField(required=False) | ||
12 | description = forms.CharField(required=False) | ||
13 | author_email = forms.CharField(required=False) | ||
14 | version = forms.CharField() | ||
15 | platform = forms.CharField(required=False) | ||
16 | |||
17 | def save(self, classifiers, file=None): | ||
18 | values = dict(self.cleaned_data) | ||
19 | name = values.pop("name") | ||
20 | version = values.pop("version") | ||
21 | platform = values.pop("platform") | ||
22 | project, c = Project.objects.get_or_create(name=name, defaults=values) | ||
23 | for classifier in classifiers: | ||
24 | project.classifiers.add( | ||
25 | Classifier.objects.get_or_create(name=classifier)[0]) | ||
26 | release, c = Release.objects.get_or_create(version=version, | ||
27 | platform=platform, project=project) | ||
28 | if file: | ||
29 | release.distribution.save(file.name, file, save=True) | ||
30 | release.save() | ||
31 | |||
32 | |||
33 | |||
34 | |||
35 | |||
diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..24a52c7 --- /dev/null +++ b/setup.py | |||
@@ -0,0 +1,34 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # -*- coding: utf-8 -*- | ||
3 | import os | ||
4 | import codecs | ||
5 | |||
6 | try: | ||
7 | from setuptools import setup, find_packages | ||
8 | except ImportError: | ||
9 | from ez_setup import use_setuptools | ||
10 | use_setuptools() | ||
11 | from setuptools import setup, find_packages | ||
12 | |||
13 | setup( | ||
14 | name='chishop', | ||
15 | version=__import__('chishop').__version__, | ||
16 | description='Simple PyPI server written in Django.', | ||
17 | author='Ask Solem', | ||
18 | author_email='askh@opera.com', | ||
19 | packages=[], | ||
20 | install_requires=[ | ||
21 | 'django>=1.0', | ||
22 | ], | ||
23 | classifiers=[ | ||
24 | "Development Status :: 3 - Alpha", | ||
25 | "Environment :: Web Environment", | ||
26 | "Framework :: Django", | ||
27 | "Operating System :: OS Independent", | ||
28 | "Intended Audience :: Developers", | ||
29 | "Intended Audience :: System Administrators", | ||
30 | "License :: OSI Approved :: BSD License", | ||
31 | "Programming Language :: Python", | ||
32 | ], | ||
33 | long_description=codecs.open('README', "r", "utf-8").read(), | ||
34 | ) | ||