Skip to content
Browse files

Added setup.py

  • Loading branch information...
1 parent cf751cd commit 41c14354fc2c9135dc98d7415b924c4a06c6d3d8 @andres-torres-marroquin committed Dec 19, 2011
View
6 django_dropbox/__init__.py
@@ -0,0 +1,6 @@
+VERSION = (0, 0, 1)
+
+def get_version():
+ return '%s.%s.%s' % VERSION
+
+version = get_version()
View
0 ...o_dropbox/management/commands/__init__.py → django_dropbox/management/__init__.py
File renamed without changes.
View
0 ...ect/django_dropbox/management/__init__.py → ...o_dropbox/management/commands/__init__.py
File renamed without changes.
View
0 .../management/commands/get_dropbox_token.py → .../management/commands/get_dropbox_token.py
File renamed without changes.
View
0 ..._dropbox_project/django_dropbox/models.py → django_dropbox/models.py
File renamed without changes.
View
0 ...ropbox_project/django_dropbox/settings.py → django_dropbox/settings.py
File renamed without changes.
View
2 ...dropbox_project/django_dropbox/storage.py → django_dropbox/storage.py
@@ -81,7 +81,7 @@ def listdir(self, path):
def size(self, name):
path = os.path.realpath(os.path.join(self.location, name))
- return self.client.metadata("dropbox", path).data['bytes']
+ return self.client.metadata(path)['bytes']
def url(self, name):
if name.startswith(self.location):
View
17 ...o_dropbox_project/django_dropbox/tests.py → django_dropbox/tests.py
@@ -73,3 +73,20 @@ def test_file_url(self):
self.storage.base_url = None
self.assertRaises(ValueError, self.storage.url, 'test.file')
+
+ def test_file_size(self):
+ """
+ File storage returns a url to access a given file from the Web.
+ """
+ self.assertFalse(self.storage.exists('storage_test_size'))
+ f = self.storage.open('storage_test_size', 'w')
+ f.write('these are 18 bytes')
+ f.close()
+ self.assertTrue(self.storage.exists('storage_test_size'))
+
+ f = self.storage.open('storage_test_size', 'r')
+ self.assertEqual(f.size, 18)
+ f.close()
+
+ self.storage.delete('storage_test_size')
+ self.assertFalse(self.storage.exists('storage_test_size'))
View
0 ...o_dropbox_project/django_dropbox/views.py → django_dropbox/views.py
File renamed without changes.
View
1 django_dropbox_project/django_dropbox
View
0 django_dropbox_project/django_dropbox/__init__.py
No changes.
View
22 setup.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+import os
+from django_dropbox import version
+from setuptools import setup
+
+def get_packages():
+ # setuptools can't do the job :(
+ packages = []
+ for root, dirnames, filenames in os.walk('django_dropbox'):
+ if '__init__.py' in filenames:
+ packages.append(".".join(os.path.split(root)).strip("."))
+
+ return packages
+
+setup(name='django-dropbox',
+ version=version,
+ description='A Django App that contains a Django Storage which uses Dropbox.',
+ author=u'Andres Torres Marroquin',
+ author_email='andres.torres.marroquin@gmail.com',
+ url='https://github.com/andres-torres-marroquin/django-dropbox',
+ packages=get_packages(),
+)

0 comments on commit 41c1435

Please sign in to comment.
Something went wrong with that request. Please try again.