[kepler-dev] Determine whether -nogui was specified

Chad Berkley berkley at nceas.ucsb.edu
Wed Aug 12 14:16:51 PDT 2009


It would be really easy to just add the command line parameters to the 
configuration on startup so you can check these things.  I'll add a bug 
to do this and hopefully get to it soon.

chad


Michal Owsiak wrote:
> Thanks for the info.
> 
> The hack-way is not a pretty solution, but it will do a thing - I will
> check that and tell you whether it works fine.
> 
> What I am trying to accomplish is creating an actor that is able to show
> dialog window - when GUI mode is enabled, and skip showing it, when
> -nogui is passed. This way I can easily (without changing actor's
> parameters within workflow) use the same scenario for both cases.
> Otherwise I have to enable/disable some parameter.
> 
> But as I have mentioned, I will check the "stack thing" - it should work.
> 
> Anyway, if it is possible to add this feature it would be fine.
> 
> Another useful feature (in case of -nogui mode) would be providing
> Kepler developers with an access to command line arguments. This way it
> would be possible to parametrize workflow from outside through the
> application's parameters - this would useful whenever Kepler is started
> as a part of a process.
> 
> Regards
> 
> michal
> 
>> There is no really good way to do this at present.
>>
>> If -nogui passed in as an argument, then that affects what is called
>> (either org.kepler.KeplerConfigurationApplication or
>> ptolemy.moml.MoMLCommandLineApplication) but unfortunately the fact that
>> -nogui was passed in is not otherwise stored.
>>
>> A hackish way to detect whether new -nogui was passed in that should
>> work (I haven't tried it) would be to examine the current stack trace
>> and see if either of the following is present.
>>
>> org.kepler.KeplerConfigurationApplication.main(String[] args)
>>
>> OR
>>
>>  ptolemy.moml.MoMLCommandLineApplication(String[] args)
>>
>> One of these classes is called if and only if -nogui was passed in as a
>> command-line argument.
>>
>> What are you trying to accomplish? Should we make it more convenient to
>> determine whether -nogui has been passed in on the command line?
>>
>> -David
>>
>>
>>
>> On Aug 12, 2009, at 2:38 AM, Michal Owsiak wrote:
>>
>>> Hello all,
>>>
>>> I want to check within the actor's fire() method whether Kepler was
>>> started with "-nogui" argument. Is it possible to determine whether this
>>> switch was used during Kepler execution? How this information can be
>>> retrieved?
>>>
>>> Regards
>>>
>>> Michal
>>>
>>> -- 
>>> Michal Owsiak <michalo at man.poznan.pl>
>>> Poznan Supercomputing and Networking Center
>>> ul. Noskowskiego 10, 61-704 Poznan, POLAND
>>> http://www.man.poznan.pl
>>> _______________________________________________
>>> Kepler-dev mailing list
>>> Kepler-dev at kepler-project.org
>>> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev
> 
> 


More information about the Kepler-dev mailing list