Permalink
Browse files

Allow funfactory to be overridden by a locally development version

  • Loading branch information...
Osmose committed Jul 27, 2011
1 parent a8984ef commit 88ae6ddd33091b906d2dadaba7daae254a882bbd
Showing with 12 additions and 7 deletions.
  1. +12 −7 manage.py
View
@@ -2,15 +2,20 @@
import os
import sys
-# Add a temporary path so that we can import the funfactory
-tmp_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
- 'vendor', 'src', 'funfactory')
-sys.path.append(tmp_path)
+try:
+ # For local development in a virtualenv:
+ from funfactory import manage
+except ImportError:
+ # Production:
+ # Add a temporary path so that we can import the funfactory
+ tmp_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
+ 'vendor', 'src', 'funfactory')
+ sys.path.append(tmp_path)
-from funfactory import manage
+ from funfactory import manage
-# Let the path magic happen in setup_environ() !
-sys.path.remove(tmp_path)
+ # Let the path magic happen in setup_environ() !
+ sys.path.remove(tmp_path)
manage.setup_environ(__file__)

0 comments on commit 88ae6dd

Please sign in to comment.