git.fiddlerwoaroof.com
Ed L authored on 23/01/2012 18:29:41
Showing 3 changed files
... ...
@@ -1,5 +1,9 @@
1 1
 #!/usr/bin/env python -O
2
-"""Edit a python file"""
2
+"""
3
+Edit a python file by its module name (i.e. twisted.internet.thread)
4
+I usually alias this to some one character symbol like ,
5
+"""
6
+
3 7
 import os
4 8
 import os.path
5 9
 import sys
... ...
@@ -5,8 +5,11 @@ class CallableGeneratorContextManager(contextlib.GeneratorContextManager):
5 5
 	def __call__(self, *a, **kw):
6 6
 		with self as obj:
7 7
 			return obj(*a, **kw)
8
-def contextmanager(func):
9
-    """@contextmanager decorator.
8
+try:
9
+	from contextlib import contextmanager
10
+except:
11
+	def contextmanager(func):
12
+ 	  """@contextmanager decorator.
10 13
 
11 14
     Typical usage:
12 15
 
... ...
@@ -1,3 +1,7 @@
1
+"""
2
+Split a file of python snippets into its constituent snippets, splitting
3
+on lines whose first non-whitespace character is #
4
+"""
1 5
 import sys
2 6
 counter = 0
3 7
 with open(sys.argv[1]) as f: