erinxocon / pyp

Automatically exported from code.google.com/p/pyp
0 stars 0 forks source link

--manual doesn't respect --turn_off_color #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
pyp --manual --turn_off_color
is colored while it shouldn't

Problem is that reassignment of class Colors to NoColors is done after class 
Docs is defined.
One quite non intrusive solution is to modify Docs.manual as such so that 
manual text is evaluated only when called:

$ diff -u /usr/bin/pyp pyp
--- /usr/bin/pyp    2012-04-04 22:02:16.000000000 +0200
+++ pyp 2012-04-19 00:23:44.183598728 +0200
@@ -1390,7 +1390,7 @@
         '''

         if options.manual:
-            print Docs.manual
+            print Docs().manual()
             sys.exit()

         if options.unmodified_config:
@@ -1476,7 +1476,8 @@

 class Docs():
-    manual = ''' 
+    def manual(self):
+        return ''' 
     ===================================================================================
     PYED PIPER MANUAL

Original issue reported on code.google.com by yob...@gmail.com on 18 Apr 2012 at 10:27

GoogleCodeExporter commented 8 years ago
ok, thanks for catching this, and especially for the code. we'll roll this out 
on the next revision.

Original comment by tobyro...@gmail.com on 18 Apr 2012 at 11:22

GoogleCodeExporter commented 8 years ago
solved! thanks for catching this!

http://code.google.com/p/pyp/

Original comment by tobyro...@gmail.com on 26 Mar 2014 at 9:55