Hi Gergely,

Here are a couple snippets that should be useful.

If I understand correctly, map_metadata is not what you need, because
it only changes existing metadata. Anyway, here's an example (a
simplification of the definition of rewrite_metata in utils.liq):

def map(m)
  # m is the list of metadata, as pairs of metadata.
  # l is a list of pairs (field_name,pattern)
  # for each of those, we evaluate the pattern on the current metadata
  def apply(x)
    label = fst(x)
    value = snd(x)
    (label,value % m)
  end
  list.map(apply,l)
end
map_metadata(map,s)

What you need is easier :) As you guessed you need add_timeout(), but
if you print() it will print on stdout (which might be closed in
daemon mode); if you log() it will go in the logs; if you want to
insert some metadata at some place, you have to setup an
insert_metadata() operator at this point, and then invoke its
insertion command from the add_timeout():

s = insert_metadata(id="xxx",s)
add_timeout(10.,{ execute('xxx.insert key1="val1",key2="val2"') })

Instead of statically putting val1, val2, you can use the result of a
system call (using get_process_output()) to one of your script. You
may also be able to generate your random string using our scripting
language, which has random.float() and random.bool().

Hope that helps,
-- 
David

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to