Hi Charlie,<br><br><div class="gmail_quote">On Mon, Sep 27, 2010 at 8:01 PM, Charlie Brej <span dir="ltr">&lt;<a href="mailto:plymouth@brej.org">plymouth@brej.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Sorry about the delay. I&#39;ll try and answer as many questions aimed for me as I find, but I will probably have missed some.</blockquote><div><br></div><div>No problem. </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
<br>
On 09/25/2010 11:50 AM, Jerome Martin wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- Is there a way to call up an external binary from plymouth, like a<br>
system() function ? If not, I guess this would not be much to add, I can<br>
do it if you give me a proper pointer in your code (hints on the proper<br>
parse token to use, etc.).<br>
</blockquote>
<br></div>
Yes possible, although I would recommend using the on keystroke execute command feature rather than letting a plugin run anything it likes. At least that way you can be sure what state the system is in.</blockquote><div>
<br></div><div>Well, this will be under control :-)</div><div>I just need a small menu (not a problem to implement) that asks a couple of questions and pass the answers to a couple of config scripts. The system is a cluster node that boots from a live system image, reads a persistent config partition and autoconfigures itself. But for seeding the cluster, or in corner cases, I need some interaction with the user to help seed the config, and I want to use plymouth for that.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- I desperately miss a couple of possibilities regarding strings, like<br>
determining a string length, and addressing strings as lists<br>
(a=&quot;foobar&quot;; c=a[2]), thus making it possible to do strings<br>
transformations, iterate on strings, etc. Did I miss something ? Would<br>
that be hard to implement ?<br>
</blockquote>
<br></div>
Ah! So there are two functions that do this. &quot;CharAt&quot; and &quot;SubString&quot;. Somehow, I forgot to add these to the wiki.<br>
<br>
&quot;String&quot;.CharAt(2) =&gt; &quot;r&quot;<br>
&quot;String&quot;.SubString(2, 4) =&gt; &quot;rin&quot;<br>
<br>
I think it is indexed starting at zero and the SubString takes inclusive start and end pointers.</blockquote><div><br></div><div>Yes, meanwhile, as I said in a later email, I noticed those in the code. I will add a String.Len() method for my needs an be all set.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- Last, but related to the previous, I currently keep an index on lists<br>
I create to knopw their length before iterating on them, but it would be<br>
nice to have a mylist.Len() method.<br>
</blockquote>
<br></div>
Are you just appending to a list by adding elements at increasing indices? list[0] = &quot;blah&quot;, list[1]=&quot;sdf&quot;...<br>
In which case you can just add a length element and keep that up to date when you add/remove elements. (list.length++ or list[&quot;length&quot;]++)</blockquote><div><br></div><div>This is what I do right now, I do the housekeeping in my script for an separate length variable. But now that I have added a couple of additional methods to plymouth script modu;e, I know how trivial it is to add that kind of thing, so I&#39;ll just do it when I do not feel to lazy/when the need is immediate.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Can any of the two previous points be done with a &quot;list | []&quot; method of<br>
sorts ?<br>
</blockquote>
<br></div>
Not really. That&#39;s a rather complex one to explain.<br></blockquote><div><br></div><div>&lt;nod&gt; </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
&gt; Things using &quot;\033&quot;<br>
<br>
There is no escaping supported in the scripted system apart from \n \&quot; and \0.<br>
<br>
Ok, sorry, just found your patch. I&#39;m split between \123 and \x123.<br></blockquote><div><br></div><div>Mhhh, I hesitated too but settled for C-like behavior.</div><div>We can make it nicer and easily support at the same time \0, \XYZ with XYZ in octal, even \XY if we add a lookahead function for the n next chars that do not shift the current char pointer.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Are there other questions I have missed?</blockquote><div><br></div><div>I think that&#39;s all, actually I solved most of it meanwhile :-)</div><div>The code is pretty clear when you get into it. It only lacks a bit of user docs.</div>
<div><br></div><div>What do you think about having a switch to hand ctrl-V, esc, etc either to the script or to the main.c code depending on the user needs ? that would allow me to submit something that could go in your git repo for my ANSI key handling logic. I could even add some examples from my code, like a log viewer that supports scrolling with up/down, things like that.</div>
<div><br></div><div>Best Regards,</div></div>-- <br>Jérôme Martin<br>