Author: Tobias Schlitt
Date: 2007-03-15 17:58:46 +0100 (Thu, 15 Mar 2007)
New Revision: 4763

Log:
- Even less code for Windows workaround.
- Updated docs.
- Fixed issue #9902: [ConsoleTools] Problems on Windows.

Modified:
   trunk/ConsoleTools/docs/tutorial.txt
   trunk/ConsoleTools/src/output.php
   trunk/ConsoleTools/src/progressbar.php

Modified: trunk/ConsoleTools/docs/tutorial.txt
===================================================================
--- trunk/ConsoleTools/docs/tutorial.txt        2007-03-15 16:50:12 UTC (rev 
4762)
+++ trunk/ConsoleTools/docs/tutorial.txt        2007-03-15 16:58:46 UTC (rev 
4763)
@@ -23,7 +23,8 @@
   It can also apply other styling information to the text, making
   it bold or underlined for example. It can automatically wrap text
   after a certain number of characters are printed (keeping words
-  intact) and handle output of different verbosity levels.
+  intact) and handle output of different verbosity levels. ATTENTION: Windows
+  does not support the styling of text.
 
 ezcConsoleInput
   Using this little tool, you can handle the options and arguments provided to

Modified: trunk/ConsoleTools/src/output.php
===================================================================
--- trunk/ConsoleTools/src/output.php   2007-03-15 16:50:12 UTC (rev 4762)
+++ trunk/ConsoleTools/src/output.php   2007-03-15 16:58:46 UTC (rev 4763)
@@ -61,6 +61,10 @@
  *
  * For a list of valid colors, style attributes and background colors, please 
  * refer to [EMAIL PROTECTED] ezcConsoleOutputFormat}.
+ *
+ * ATTENTION: Windows operating systems do not support styling of text on the
+ * console. Therefore no styling sequences are generated on any version of
+ * this operating system.
  * 
  * @property ezcConsoleOutputOptions $options
  *           Contains the options for this class.

Modified: trunk/ConsoleTools/src/progressbar.php
===================================================================
--- trunk/ConsoleTools/src/progressbar.php      2007-03-15 16:50:12 UTC (rev 
4762)
+++ trunk/ConsoleTools/src/progressbar.php      2007-03-15 16:58:46 UTC (rev 
4763)
@@ -277,10 +277,7 @@
     public function start() 
     {
         $this->calculateMeasures();
-        if ( ezcBaseFeatures::os() !== "Windows" )
-        {
-            $this->output->storePos();
-        }
+        $this->output->storePos();
         $this->started = true;
     }
 
@@ -298,14 +295,10 @@
             $this->start();
         }
 
-        switch ( ezcBaseFeatures::os() )
+        $this->output->restorePos();
+        if ( ezcBaseFeatures::os() === "Windows" )
         {
-            case "Windows":
-                echo str_repeat( "\x8", $this->options->width );
-                break;
-            default:
-                $this->output->restorePos();
-                break;
+            echo str_repeat( "\x8", $this->options->width );
         }
 
         $this->generateValues();

-- 
svn-components mailing list
svn-components@lists.ez.no
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to