[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21640] branches/blender2.5/blender/ release/ui/space_console.py: grr, py 2.5 2.6 and 3. x need different StringIO's

Nathan Letwory jesterking at letwory.net
Fri Jul 17 08:43:03 CEST 2009


lguillaume wrote:
> Hi, with the console inside Blender, it is possible to remove the dos
> window, for windows system?

Whenever the pyconsole works properly (good output, copy/paste), yes, 
that should be possible. If you have editbin.exe, you can already change 
the subsystem for Blender without having to recompile. Just change the 
subsystem to WINDOWS instead of CONSOLE with it and voilá.

/Nathan

> 
> 2009/7/17 Campbell Barton <ideasman42 at gmail.com>
> 
>> Revision: 21640
>>
>> http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21640
>> Author:   campbellbarton
>> Date:     2009-07-17 01:04:29 +0200 (Fri, 17 Jul 2009)
>>
>> Log Message:
>> -----------
>> grr, py 2.5 2.6 and 3.x need different StringIO's
>>
>> Modified Paths:
>> --------------
>>    branches/blender2.5/blender/release/ui/space_console.py
>>
>> Modified: branches/blender2.5/blender/release/ui/space_console.py
>> ===================================================================
>> --- branches/blender2.5/blender/release/ui/space_console.py     2009-07-16
>> 22:47:27 UTC (rev 21639)
>> +++ branches/blender2.5/blender/release/ui/space_console.py     2009-07-16
>> 23:04:29 UTC (rev 21640)
>> @@ -71,14 +71,19 @@
>>
>>                console = code.InteractiveConsole(namespace)
>>
>> -               if sys.version.startswith('2'):
>> -                       import cStringIO
>> -                       stdout = cStringIO.BytesIO()  # Py2x support
>> -                       stderr = cStringIO.BytesIO()
>> -               else:
>> +               if sys.version.startswith('3'):
>>                        import io
>>                        stdout = io.StringIO()
>>                        stderr = io.StringIO()
>> +               elif sys.version.startswith('2.6'):
>> +                       import io
>> +                       stdout = io.BytesIO()  # Py2x support
>> +                       stderr = io.BytesIO()
>> +               else:
>> +                       import cStringIO
>> +                       stdout = cStringIO.StringIO()
>> +                       stderr = cStringIO.StringIO()
>> +
>>
>>                consoles[console_id]= namespace, console, stdout, stderr
>>
>>
>>
>> _______________________________________________
>> Bf-blender-cvs mailing list
>> Bf-blender-cvs at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
> 


-- 

Nathan Letwory

http://www.planetblender.org | http://www.blender-fi.org


More information about the Bf-committers mailing list