Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add pep8 (http://www.python.org/dev/peps/pep-0008/) and encode

  • Loading branch information...
commit eab6626011fda8a6b843461a2b6fbba3566b9115 1 parent 4fc27b7
Thiago Avelino authored November 24, 2011
22  examples/decorators.py
... ...
@@ -1,14 +1,20 @@
  1
+# -*- coding: utf-8 -*-
  2
+
1 3
 class test(object):
2  
-  @staticmethod
3  
-  def static(a,b,c):
4  
-    print a, b, c
5  
-    
6  
-  @classmethod
7  
-  def clsm(cls, a, b, c):
8  
-    print cls, a, b, c
  4
+
  5
+    @staticmethod
  6
+    def static(a,b,c):
  7
+
  8
+      print a, b, c
  9
+
  10
+    @classmethod
  11
+    def clsm(cls, a, b, c):
  12
+
  13
+      print cls, a, b, c
  14
+
9 15
 
10 16
 test.static(1,2,3) # => "1 2 3"
11 17
 test.clsm(1,2,3) # => "<type 'test'> 1 2 3"
12 18
 
13 19
 test().static(1,2,3) # => "1 2 3"
14  
-test().clsm(1,2,3) # => "<type 'test'> 1 2 3"
  20
+test().clsm(1,2,3) # => "<type 'test'> 1 2 3"
28  examples/descriptors.py
... ...
@@ -1,16 +1,28 @@
  1
+# -*- coding: utf-8 -*-
  2
+
1 3
 class DataDesc(object):
2  
-  def __get__(self, obj, type):
3  
-    print "datadesc", self, obj, type
4  
-  def __set__(self, obj, val):
5  
-    print "datadesc", self, obj, val
  4
+
  5
+    def __get__(self, obj, type):
  6
+
  7
+        print "datadesc", self, obj, type
  8
+
  9
+    def __set__(self, obj, val):
  10
+
  11
+        print "datadesc", self, obj, val
  12
+
6 13
 
7 14
 class Desc(object):
8  
-  def __get__(self, obj, type):
9  
-    print "desc", self, obj, type
  15
+
  16
+    def __get__(self, obj, type):
  17
+
  18
+        print "desc", self, obj, type
  19
+
10 20
 
11 21
 class test(object):
12  
-  dd = DataDesc()
13  
-  d = Desc()
  22
+
  23
+    dd = DataDesc()
  24
+    d = Desc()
  25
+
14 26
 
15 27
 #__debugger__()
16 28
 test.dd
29  examples/embed_func.py
... ...
@@ -1,18 +1,21 @@
  1
+# -*- coding: utf-8 -*-
  2
+
1 3
 z = 'watevah'
2 4
 
3 5
 def blah(a,k='b'):
4  
- def blorp(b):
5  
-  print(b) #3
6  
-  print(a) #4
7  
-  print(z) #5
8  
-  print(__name__) #6
9  
-  
10  
- l = lambda x: x
11  
- #def l(x): return x
12  
-   
13  
- print(l("zoom!")) #1
14  
- 
15  
- print(a,k) #2
16  
- blorp("boom")
  6
+
  7
+    def blorp(b):
  8
+
  9
+        print(b) #3
  10
+        print(a) #4
  11
+        print(z) #5
  12
+        print(__name__) #6
  13
+
  14
+    l = lambda x: x
  15
+    #def l(x): return x
  16
+    print(l("zoom!")) #1
  17
+    print(a,k) #2
  18
+    blorp("boom")
  19
+
17 20
 
18 21
 blah("floom")
2  examples/eval.py
... ...
@@ -1,3 +1,5 @@
  1
+# -*- coding: utf-8 -*-
  2
+
1 3
 a = 22
2 4
 b = eval("a * 33")
3 5
 print b
4  examples/from_import.py
... ...
@@ -1,2 +1,6 @@
  1
+# -*- coding: utf-8 -*-
  2
+
1 3
 from imported import foo
  4
+
  5
+
2 6
 print foo()
4  examples/from_import_as.py
... ...
@@ -1,2 +1,6 @@
  1
+# -*- coding: utf-8 -*-
  2
+
1 3
 from imported import foo as bar
  4
+
  5
+
2 6
 print bar()
5  examples/func.py
... ...
@@ -1,9 +1,14 @@
  1
+# -*- coding: utf-8 -*-
  2
+
1 3
 def greet(name, wat, blorp = 'woop', zoop = 'noop'):
  4
+
2 5
     print '---'
3 6
     print 'hello', name
4 7
     print 'wat:', wat
5 8
     print 'blorp:', blorp
6 9
     print 'zoop:', zoop
  10
+
  11
+
7 12
 greet('Jack', 'stuff')
8 13
 greet('Jill', 'cffuf', 'tuff')
9 14
 greet('Bob', 'wat')
2  examples/hello.py
... ...
@@ -1 +1,3 @@
  1
+# -*- coding: utf-8 -*-
  2
+
1 3
 print("hello world")
7  examples/import.py
... ...
@@ -1,6 +1,7 @@
1  
-import imported
2  
-
3  
-print(imported.__doc__)
  1
+# -*- coding: utf-8 -*-
4 2
 
  3
+import imported
5 4
 import foo.bar
6 5
 
  6
+
  7
+print(imported.__doc__)
6  examples/import_as.py
... ...
@@ -1,2 +1,6 @@
  1
+# -*- coding: utf-8 -*-
  2
+
1 3
 import imported as foo
2  
-print(foo.__name__) # => "imported"
  4
+
  5
+# => "imported"
  6
+print(foo.__name__)
4  examples/imported.py
... ...
@@ -1,6 +1,8 @@
1  
-"imported module"
  1
+# -*- coding: utf-8 -*-
2 2
 
3 3
 def foo():
  4
+    """imported module"""
4 5
     return "FOO"
5 6
 
  7
+
6 8
 print __name__
2  examples/literals.py
... ...
@@ -1,3 +1,5 @@
  1
+# -*- coding: utf-8 -*-
  2
+
1 3
 1
2 4
 2.3
3 5
 "a b c"
5  examples/numbers.py
... ...
@@ -1,7 +1,10 @@
  1
+# -*- coding: utf-8 -*-
  2
+
1 3
 print "boom"
2 4
 
3 5
 x = 1
4  
-y = 100000*100000 # current parser blows up on long numbers.
  6
+# current parser blows up on long numbers.
  7
+y = 100000*100000 
5 8
 z = 10000
6 9
 
7 10
 #__debugger__()
4  examples/pass.py
... ...
@@ -1,3 +1,7 @@
  1
+# -*- coding: utf-8 -*-
  2
+
1 3
 def foo():
2 4
     pass
  5
+
  6
+
3 7
 print foo()
6  examples/ruby.py
... ...
@@ -1,6 +1,8 @@
1  
-from __ruby__ import require
  1
+# -*- coding: utf-8 -*-
2 2
 
3  
-require('rbconfig')
  3
+from __ruby__ import require
4 4
 from __ruby__.Config.CONFIG import fetch as rb
5 5
 
  6
+
  7
+require('rbconfig')
6 8
 print rb("RUBY_INSTALL_NAME") # => rbx
4  examples/singletons.py
... ...
@@ -1,4 +1,6 @@
  1
+# -*- coding: utf-8 -*-
  2
+
1 3
 print None
2 4
 print None.__class__
3 5
 print NotImplemented
4  
-print NotImplemented.__class__
  6
+print NotImplemented.__class__

0 notes on commit eab6626

Please sign in to comment.
Something went wrong with that request. Please try again.