0a0ec65f5e57

Skeleton.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sun, 12 Jun 2011 20:12:48 -0400
parents ee71fd579f4f
children adb7e3942b34
branches/tags (none)
files plugin/threesome.py plugin/threesome.vim plugin/threesomelib.py plugin/threesomelib/__init__.py plugin/threesomelib/init.py plugin/threesomelib/modes.py plugin/threesomelib/util.py

Changes

--- a/plugin/threesome.py	Sun Jun 12 19:51:53 2011 -0400
+++ b/plugin/threesome.py	Sun Jun 12 20:12:48 2011 -0400
@@ -1,4 +1,13 @@
-import threesomelib
+import vim, os, sys
+
+# Add the library to the Python path.
+for p in vim.eval("&runtimepath").split(','):
+   plugin_dir = os.path.join(p, "plugin")
+   if os.path.exists(os.path.join(plugin_dir, "threesomelib")):
+      if plugin_dir not in sys.path:
+         sys.path.append(plugin_dir)
+      break
 
 def ThreesomeInit():
-    threesomelib.init()
+    from threesomelib.init import init
+    init()
--- a/plugin/threesome.vim	Sun Jun 12 19:51:53 2011 -0400
+++ b/plugin/threesome.vim	Sun Jun 12 20:12:48 2011 -0400
@@ -66,7 +66,7 @@
 function! s:ThreesomeInit()"{{{
     let python_module = fnameescape(globpath(&runtimepath, 'plugin/threesome.py'))
     exe 'pyfile ' . python_module
-    python "ThreesomeInit()"
+    python ThreesomeInit()
 endfunction"}}}
 
 "}}}
--- a/plugin/threesomelib.py	Sun Jun 12 19:51:53 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-import vim
-
-vim.echo('lololol')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugin/threesomelib/init.py	Sun Jun 12 20:12:48 2011 -0400
@@ -0,0 +1,2 @@
+def init():
+    pass
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugin/threesomelib/modes.py	Sun Jun 12 20:12:48 2011 -0400
@@ -0,0 +1,2 @@
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugin/threesomelib/util.py	Sun Jun 12 20:12:48 2011 -0400
@@ -0,0 +1,4 @@
+import sys
+
+def error(m):
+    sys.stdout.write(m + '\n')