Univention Bugzilla – Attachment 5831 Details for
Bug 32743
UCR Python API for setting and unsetting UCRVs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Update for ucr_update()
32743_devdoc-ucr-update,diff (text/plain), 2.51 KB, created by
Philipp Hahn
on 2014-03-17 15:54:38 CET
(
hide
)
Description:
Update for ucr_update()
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2014-03-17 15:54:38 CET
Size:
2.51 KB
patch
obsolete
>diff --git a/branches/ucs-3.2/ucs-3.2-1/doc/developer-reference/developer-reference-3.2.xml b/branches/ucs-3.2/ucs-3.2-1/doc/developer-reference/developer-reference-3.2.xml >index 6d1fc74..66991d3 100644 >--- a/branches/ucs-3.2/ucs-3.2-1/doc/developer-reference/developer-reference-3.2.xml >+++ b/branches/ucs-3.2/ucs-3.2-1/doc/developer-reference/developer-reference-3.2.xml >@@ -33,8 +33,8 @@ > </legalnotice> > <revhistory> > <revision> >- <revnumber>3.2-0</revnumber> >- <date>19th of November 2013</date> >+ <revnumber>3.2-1</revnumber> >+ <date>17th of March 2014</date> > </revision> > </revhistory> > </bookinfo> >diff --git a/branches/ucs-3.2/ucs-3.2-1/doc/developer-reference/ucr/ucr.xml b/branches/ucs-3.2/ucs-3.2-1/doc/developer-reference/ucr/ucr.xml >index ed2ac93..8718766 100644 >--- a/branches/ucs-3.2/ucs-3.2-1/doc/developer-reference/ucr/ucr.xml >+++ b/branches/ucs-3.2/ucs-3.2-1/doc/developer-reference/ucr/ucr.xml >@@ -203,21 +203,26 @@ if ucr.is_false('repository/online/unmaintained', True): > </example> > <para> > Modifying variables requires a different approach. >- Two functions <function>handler_set()</function> and <function>handler_unset()</function> can be used to set and unset variables. >+ The function <function>ucr_update()</function> should be used to set and unset variables. > </para> > <example> > <title>Changing &ucsUCRV;s in Python</title> > <programlisting><![CDATA[ >-from univention.config_registry import handler_set, handler_unset >-handler_set([ >- 'foo=bar', >- 'baz=42', >- ]) >-handler_unset(['foo', 'bar']) >+from univention.config_registry.handler import ucr_update >+ucr_update(ucr, { >+ 'foo': 'bar', >+ 'baz': '42', >+ 'bar': None, >+ }) > ]]></programlisting> > </example> > <para> >- As <function>handler_set()</function> and <function>handler_unset()</function> don't automatically update any instance of <classname>ConfigRegistry</classname>, the <methodname>load()</methodname> method has to be called manually afterwards to reflect the updated values. >+ The function <function>ucr_update()</function> requires an instance of <classname>ConfigRegistry</classname> as its first argument. >+ The method is guaranteed to be atomic and uses file locking internally to prevent race conditions. >+ </para> >+ <para> >+ The second argument must be a Python dictionary mapping <acronym>UCR</acronym> variable names to their new value. >+ The value must be either a string or <constant>None</constant>, which is used to unset the variable. > </para> > </section> > </section>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 32743
:
5831
|
5832