[Gelistirici] servislerdeki comar config.get() ve notify fonksiyonlari

Bahadır Kandemir bahadir at pardus.org.tr
18 Şub 2009 Çar 23:17:27 EET


18 Şub 2009 Çar tarihinde, Emre Erenoglu şunları yazmıştı: 
> Ozellikle 2 kullanim tarzi gozume carpti, birisi:
> config.get("DEGISKEN_ISMI", "")  seklinde iken, digeri
> config.get("DEGISKEN_ISMI", "bir_deger") seklinde.

/etc/conf.d/<servis_adı> dosyası okunduktan sonra config adlı bir dict 
nesnesine aktarılıyor.

dict.get() metodu şu işi yapıyor:

  d = {"a": 1, "c": 3}
  print d.get("b", "x") => "x"
  print d.get("b", "") => ""

> notify fonksiyonunda ise iki cesit kullanim var, birinde 2 parametre
> varken, digerinde 3 parametre isteniyor gibi.

notify() metodu sinyal göndermek için kullanılıyor:

  notify("Model", "Sinyal", (arg1, arg2, arg3))

Şu kullanım yanlış:

  notify("System.Service.changed", "started")

System.Service modeli ile ilgili dökümantasyon uludag/branches/comar-3.0 
altında.
-------------- sonraki bölüm --------------
A non-text attachment was scrubbed...
Name: kullanılamıyor
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://liste.pardus.org.tr/gelistirici/attachments/20090218/015f0a4f/attachment-0002.pgp>


Gelistirici mesaj listesiyle ilgili daha fazla bilgi