Permalink
Browse files

Finally created propert import

  • Loading branch information...
1 parent ecac29f commit 28f6a9add2ca6a4566857d5046850602c46dcad4 @joequery committed Jun 3, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 tasks/grab_feed.py
View
@@ -1,8 +1,10 @@
import os
-# We're 2 away from the parent directory (PARENT/tasks/somefile.py)
+# Hack to import modules from a sibling directory. Ew >_>
+# parentDir is just the root directory of the project.
parentDir = os.path.abspath(__file__).rsplit('/', 2)[0]
-import sys; sys.path.insert(0, parentDir)
-import helpers
+vertDir = os.path.join(parentDir, "vertstudios")
+import sys; sys.path.append(vertDir)
+import helpers.rss
-print(dir(helpers))
+print(dir(helpers.rss))

0 comments on commit 28f6a9a

Please sign in to comment.