Re: Softimage and Python For Linux

2013-02-01 Thread Peter Agg
 We use 2.65 here, and are nervous as to whether our tools will continue
to work in linux
You'll probably be fine. There's not THAT many changes between 2.5 and 2.6,
frankly.

Exception handling is the major one though and can certainly affect common
modules and the like (keep an eye out for unhelpful 'Error on line n' when
you import things into 2.5). The fact that the Python folks decided to
change syntax in a minor version is a little mind boggling, but there have
you.




On 1 February 2013 05:04, Alan Fregtman alan.fregt...@gmail.com wrote:


  It says in the documentation that Softimage only works with Python 2.5
 in linux, is this factual?
 Yes, yes it is.

  We use 2.65 here, and are nervous as to whether our tools will continue
 to work in linux
 You'll probably be fine. There's not THAT many changes between 2.5 and
 2.6, frankly.

  can we use alternative versions of python with softimage in linux?
 Nope! You can only use Softimage's, which is heavily tied with the
 ActiveScripting technology and Mainwin's grubby win32com hooks.

 It's not unimaginable that a future version of XSI may come with a newer
 build of Python. Only time will tell.



 On Thu, Jan 31, 2013 at 11:49 PM, Enrique Caballero 
 enriquecaball...@gmail.com wrote:

 Hey guys,
   Im not a linux guy, but we are transfering some of our machines over to
 Linux here at the studio, and its our first time doing this so we are a bit
 clueless.

 It says in the documentation that Softimage only works with Python 2.5 in
 linux,  is this factual? We use 2.65 here, and are nervous as to whether
 our tools will continue to work in linux

 can we use alternative versions of python with softimage in linux?

 thanks,

  Enrique





Re: Softimage and Python For Linux

2013-01-31 Thread Alan Fregtman
 It says in the documentation that Softimage only works with Python 2.5
in linux, is this factual?
Yes, yes it is.

 We use 2.65 here, and are nervous as to whether our tools will continue
to work in linux
You'll probably be fine. There's not THAT many changes between 2.5 and 2.6,
frankly.

 can we use alternative versions of python with softimage in linux?
Nope! You can only use Softimage's, which is heavily tied with the
ActiveScripting technology and Mainwin's grubby win32com hooks.

It's not unimaginable that a future version of XSI may come with a newer
build of Python. Only time will tell.



On Thu, Jan 31, 2013 at 11:49 PM, Enrique Caballero 
enriquecaball...@gmail.com wrote:

 Hey guys,
   Im not a linux guy, but we are transfering some of our machines over to
 Linux here at the studio, and its our first time doing this so we are a bit
 clueless.

 It says in the documentation that Softimage only works with Python 2.5 in
 linux,  is this factual? We use 2.65 here, and are nervous as to whether
 our tools will continue to work in linux

 can we use alternative versions of python with softimage in linux?

 thanks,

  Enrique



Re: Python on Linux

2012-09-18 Thread Xavier Lapointe
Hmm, but this can have nasty side effects (recently experienced it).
Someone pointed out to me that you can actually pass the *env *keyword
argument in the subprocess call and pass a *copy *of the current
environment instead (with necessary modifications).


On Fri, Sep 14, 2012 at 12:33 AM, Alan Fregtman alan.fregt...@gmail.comwrote:

 Hey X,

 About the 3rd item, you just need to make sure the system libraries are
 loaded before XSI's own by putting them first in the 
 *LD_LIBRARY_PATH*environment variable.

 Here's a workaround sample code to start subprocesses in Linux that worked
 for me last time:

 import osimport subprocess

 inLinux = Application.Platform.startswith(Linux)if inLinux:
 exe = XSIUtils.BuildPath( pDir, executable)
 ldEnv = LD_LIBRARY_PATH
 sysLibDir = r/usr/lib64
 ld_oldVal = os.environ[ldEnv]
 os.environ[ldEnv] = sysLibDir+:+os.environ[ldEnv]

 command = r'/path/to/awesome/tool blablabla arguments here'
 proc = subprocess.Popen( command.split(), stdout=subprocess.PIPE, 
 stderr=subprocess.PIPE )
 out, err = proc.communicate()print stdout: %s % outprint return code: %s 
 % err
 if inLinux:
 # Reset to old values like the good samaritan coder we are. :p
 os.environ[ldEnv] = ld_oldVal


 As a matter of fact, it was thanks to you that I figured this one out at
 the time. :p

 Cheers,

-- Alan


 On Tue, Sep 11, 2012 at 8:19 PM, Xavier Lapointe xl.mailingl...@gmail.com
  wrote:


- You might have to import __*future*__ in order to have access to
some statement like *with*
- The @property decorator does not work
- Keep in mind that if you use a newer version of linux that the one
supported, you might have trouble starting subprocesses, since the libc
version coming with soft will override the one on the system (but it's
still possible).
- For plugins it should be too bad, but for libs, I would consider
running some unittest if I were you


 Cheers





-- 
Xavier


Re: Python on Linux

2012-09-18 Thread Alan Fregtman
Oh, good to know! Neat. :)

On Tue, Sep 18, 2012 at 2:20 AM, Xavier Lapointe
xl.mailingl...@gmail.com wrote:
 Hmm, but this can have nasty side effects (recently experienced it). Someone
 pointed out to me that you can actually pass the env keyword argument in the
 subprocess call and pass a copy of the current environment instead (with
 necessary modifications).


 On Fri, Sep 14, 2012 at 12:33 AM, Alan Fregtman alan.fregt...@gmail.com
 wrote:

 Hey X,

 About the 3rd item, you just need to make sure the system libraries are
 loaded before XSI's own by putting them first in the LD_LIBRARY_PATH
 environment variable.

 Here's a workaround sample code to start subprocesses in Linux that worked
 for me last time:

 import os
 import subprocess

 inLinux = Application.Platform.startswith(Linux)
 if inLinux:
 exe = XSIUtils.BuildPath( pDir, executable)
 ldEnv = LD_LIBRARY_PATH
 sysLibDir = r/usr/lib64
 ld_oldVal = os.environ[ldEnv]
 os.environ[ldEnv] = sysLibDir+:+os.environ[ldEnv]

 command = r'/path/to/awesome/tool blablabla arguments here'
 proc = subprocess.Popen( command.split(), stdout=subprocess.PIPE,
 stderr=subprocess.PIPE )
 out, err = proc.communicate()
 print stdout: %s % out
 print return code: %s % err

 if inLinux:
 # Reset to old values like the good samaritan coder we are. :p
 os.environ[ldEnv] = ld_oldVal


 As a matter of fact, it was thanks to you that I figured this one out at
 the time. :p

 Cheers,

-- Alan


 On Tue, Sep 11, 2012 at 8:19 PM, Xavier Lapointe
 xl.mailingl...@gmail.com wrote:

 You might have to import __future__ in order to have access to some
 statement like with
 The @property decorator does not work
 Keep in mind that if you use a newer version of linux that the one
 supported, you might have trouble starting subprocesses, since the libc
 version coming with soft will override the one on the system (but it's still
 possible).
 For plugins it should be too bad, but for libs, I would consider running
 some unittest if I were you


 Cheers






 --
 Xavier


Re: Python on Linux

2012-09-13 Thread Alan Fregtman
Hey X,

About the 3rd item, you just need to make sure the system libraries are
loaded before XSI's own by putting them first in the
*LD_LIBRARY_PATH*environment variable.

Here's a workaround sample code to start subprocesses in Linux that worked
for me last time:

import osimport subprocess

inLinux = Application.Platform.startswith(Linux)if inLinux:
exe = XSIUtils.BuildPath( pDir, executable)
ldEnv = LD_LIBRARY_PATH
sysLibDir = r/usr/lib64
ld_oldVal = os.environ[ldEnv]
os.environ[ldEnv] = sysLibDir+:+os.environ[ldEnv]

command = r'/path/to/awesome/tool blablabla arguments here'
proc = subprocess.Popen( command.split(), stdout=subprocess.PIPE,
stderr=subprocess.PIPE )
out, err = proc.communicate()print stdout: %s % outprint return
code: %s % err
if inLinux:
# Reset to old values like the good samaritan coder we are. :p
os.environ[ldEnv] = ld_oldVal


As a matter of fact, it was thanks to you that I figured this one out at
the time. :p

Cheers,

   -- Alan


On Tue, Sep 11, 2012 at 8:19 PM, Xavier Lapointe
xl.mailingl...@gmail.comwrote:


- You might have to import __*future*__ in order to have access to
some statement like *with*
- The @property decorator does not work
- Keep in mind that if you use a newer version of linux that the one
supported, you might have trouble starting subprocesses, since the libc
version coming with soft will override the one on the system (but it's
still possible).
- For plugins it should be too bad, but for libs, I would consider
running some unittest if I were you


 Cheers




Re: Python on Linux

2012-09-11 Thread Raffaele Fragapane
You'll be version locked to what comes with Soft, and relatively
independent by other installs. For good or for bad.
Mostly anything that is version compatible with that will be fine and more
or less the same between windows and linux.

On Wed, Sep 12, 2012 at 9:55 AM, Gustavo Eggert Boehs
gustav...@gmail.comwrote:

 Hello guys, quick question

 Anything special about Softimage's Python installation running on Linux?
 Should everything that works on Windows be expected to automagically work
 there also? Is there something that I should be aware of beforehand?

 Thanks in advance
 --
 Gustavo E Boehs




-- 
Our users will know fear and cower before our software! Ship it! Ship it
and let them flee like the dogs they are!


Re: Python on Linux

2012-09-11 Thread Eric Thivierge
Linux uses 2.5. Some things like exception handling needs to comply:

Python 2.6 +
Except exception as e:

should be:
Except exception, e:

All I can think of from my knowledge. Some libraries aren't in there as
well but maybe in the future package.


Eric Thivierge
http://www.ethivierge.com


On Wed, Sep 12, 2012 at 9:55 AM, Gustavo Eggert Boehs
gustav...@gmail.comwrote:

 Hello guys, quick question

 Anything special about Softimage's Python installation running on Linux?
 Should everything that works on Windows be expected to automagically work
 there also? Is there something that I should be aware of beforehand?

 Thanks in advance
 --
 Gustavo E Boehs



Re: Python on Linux

2012-09-11 Thread Xavier Lapointe
On Wed, Sep 12, 2012 at 10:19 AM, Xavier Lapointe
xl.mailingl...@gmail.comwrote:


- You might have to import __*future*__ in order to have access to
some statement like *with*
- The @property decorator does not work
- Keep in mind that if you use a newer version of linux that the one
supported, you might have trouble starting subprocesses, since the libc
version coming with soft will override the one on the system (but it's
still possible).
- For plugins it should be too bad, but for libs, I would consider
running some unittest if I were you


 Cheers

 *For plugins it should*n't* be too bad,


-- 
Xavier


Re: Python on Linux

2012-09-11 Thread Raffaele Fragapane
The property decorator will work fine in 2.5, one of our APIs used it
extensively inside XSI before a refactor.
What was introduced in 2.6, that you will be missing out on, are
setter/getter/deleter decorators relater to @property, which I actually did
really miss when I was writing some of those objects.

This is getting a bit specific though, and it will depend on what version
of Soft you will be running, as the environment changed across some
versions. It all boils down to what version of python comes with XSI, see
first reply.

On Wed, Sep 12, 2012 at 10:19 AM, Xavier Lapointe
xl.mailingl...@gmail.comwrote:


- You might have to import __*future*__ in order to have access to
some statement like *with*
- The @property decorator does not work
- Keep in mind that if you use a newer version of linux that the one
supported, you might have trouble starting subprocesses, since the libc
version coming with soft will override the one on the system (but it's
still possible).
- For plugins it should be too bad, but for libs, I would consider
running some unittest if I were you


 Cheers




-- 
Our users will know fear and cower before our software! Ship it! Ship it
and let them flee like the dogs they are!


Re: Python on Linux

2012-09-11 Thread Gustavo Eggert Boehs
Thank you guys for the fast feedback :)
Much apreciated! Ill have to check my code now to see if I'm using
something I should not.

Is that Python for XSI course ever coming out Raffaele? Just curious :D

Cheers


Re: Python on Linux

2012-09-11 Thread Raffaele Fragapane
If you do a conforming pass to python2.5 your code should run fine, or with
very minimal tweaks.
Dispatching issues these days are few and far apart, and not all that
misaligned between win and Linux (if at all).

And yes, that course is coming out, thanks for asking :)
We more or less finalized everything with CGS at this point, they have
infrastructure work they are polishing before the first batch of releases,
but it's pretty close at this point.

I can't give an exact date, because I don't know it (not because there's
any secrecy involved), but a semi-arsed guess would be before the end of
next month. Fingers crossed, it's been in gestation for a while, but that's
probably for good as they seem to have taken onto some new publishing
models and releases very seriously and don't want to risk a messy or
incomplete release.

On Wed, Sep 12, 2012 at 10:38 AM, Gustavo Eggert Boehs
gustav...@gmail.comwrote:

 Thank you guys for the fast feedback :)
 Much apreciated! Ill have to check my code now to see if I'm using
 something I should not.

 Is that Python for XSI course ever coming out Raffaele? Just curious :D

 Cheers




-- 
Our users will know fear and cower before our software! Ship it! Ship it
and let them flee like the dogs they are!