Re: Checking HOSTNAME in an ipelet

Otfried Cheong <[email protected]>
Newsgroups gmane.comp.graphics.ipe.general
Organization Ipe Headquarters
Message-ID <[email protected]>
On 11/09/2010 08:47 AM, Dmitriy Morozov wrote:
>>> if os.getenv("HOSTNAME") == "cole" then
>>
>> Ipelets run in a protected environment.
>>
>> Use _G.os.getenv to access the getenv function.
>
> _G.os.getenv("HOSTNAME") returned nil, whereas from within Lua
> interpreter it returns the actual hostname.

Perhaps because you ran lua from a shell that sets HOSTNAME, and Ipe is 
not run from the shell?

I don't know what your system is like, but on my Ubuntu system there is 
no HOSTNAME environment variable.

I guess Ipe could provide the screen geometry to the lua environment, 
then you wouldn't have to play such tricks.  Or set a dedicated 
environment variable (IPEWINDOWSIZE) on the machines where you want the 
window to be big?

Otfried
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.