|
From: Kevin B. <kb...@ca...> - 2001-11-21 19:18:57
|
Humbel Otmar wrote: >I am willing to give the new javaos.py a try on eServer iSeries >(formerly AS/400) during the next 2 weeks, but I am feeling kinda newbie >concerning the os module. > Great! The particular items that Finn was wondering about for AS/400 are the 'current directory' and 'parent directory' strings (in Unix/dos they are '.' and '..', respectively). Do you know those strings? More below. > >Therefore two questions: > >1. >Can I take the released 2.1a2 version and just replace javaos.py, or do >I have to build the current cvs snapshot ? > The most recent non-cvs snaphot release is 2.1a3, and that should work fine (it is what I've been using). Not sure about .1a2 and older. > >2. >What kind of tests are you interested in mostly ? >Are there any automated tests (I remember reading something about >__test() but haven't any clue how to use it). > There is a (rather poorly factored) __test() method, and basically, if it didn't throw an exception, it mostly worked. :-) However, it executes several 'system' commands and it really only looks at the first line of output, and doesn't check that very well... You can check visually as it prints the command it is executing, and you can see if the output makes sense for that command... (yuck) I would expect it to fail pretty miserably on AS400 right now (and Macintosh, if anyone out there is interested in getting it working for Mac), because it only knows to execute commands with 'cmd /c COMMAND' or 'command.com /c COMMAND' or 'sh -c COMMAND', so on Mac we don't get any system/environment functionality, and on AS400 it will likely try to work like Unix, and fail. javaos.py needs the following information for a new platform (and if you can give some earlier items w/o the later items, it can give partial functionality): 1- how to recognize the new platform, that is, what System.getProperty( "os.name" ) returns and any variations on it, and an internal name for the platform (as400?). This is used to determine which values are used for the following items. 2- os.curdir, os.pardir need current directory and parent directory strings ('.', and '..', respectively). 3- os.system needs the command to "execute a command in a shell" ('sh -c'). 4- os.environ needs os.system and the command to print out the environment as "name=value" pairs. Also, needs to know if the environment variable names are case sensitive (unix) or insensitive (dos). ... which reminds me that we can provide 'os.system' even if we can't get environment variables, which isn't supported by the current _ShellEnv/_NullEnv factoring... I need to fix the default behavior - I don't think the CPython behavior (import error if no os-specific module available) is right for Jython. I think I'll convert back to the original "empty environment" as the fallback - though the additional testing/feedback provided by having it enabled is nice! :-) kb |