Commits

Matthew Schinckel committed 3b6a06c

Initial import

  • Participants

Comments (0)

Files changed (7)

+build
+dist
+recursive-include bshell/*

File bshell/__init__.py

Empty file added.

File bshell/management/__init__.py

Empty file added.

File bshell/management/commands/__init__.py

Empty file added.

File bshell/management/commands/bshell.py

+import os
+from django.core.management.base import NoArgsCommand
+from optparse import make_option
+
+class Command(NoArgsCommand):
+    help = "Runs the bpython interactive interpreter if it's installed."
+    requires_model_validation = False
+
+    def handle_noargs(self, **options):
+        from django.db.models.loading import get_models
+        loaded_models = get_models()
+        locals_ = {}
+        for model in loaded_models:
+            locals_[model.__name__] = model
+        del loaded_models, model, options, get_models
+        locals_.update(**locals())
+        locals_.pop('locals_')
+        locals_.pop('self')
+        import bpython
+        bpython.embed(locals_)
+from ez_setup import use_setuptools
+use_setuptools()
+from setuptools import setup, find_packages
+
+setup(
+    name = "django_bshell",
+    version = "1.0",
+    description = "Django management command to run bshell, and import all models",
+    url = "http://bitbucket.org/schinckel/django-bpython/",
+    author = "Matthew Schinckel",
+    author_email = "matt@schinckel.net",
+    packages = find_packages(exclude='tests'),
+    setup_requires = [
+    ],
+)