Univention Bugzilla – Attachment 5832 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() v2
32743_devdoc-ucr-update.diff (text/plain), 6.68 KB, created by
Philipp Hahn
on 2014-03-17 16:26:23 CET
(
hide
)
Description:
Update for ucr_update() v2
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2014-03-17 16:26:23 CET
Size:
6.68 KB
patch
obsolete
>diff --git a/branches/ucs-3.2/doc-common/docbook/stylesheets/macros-de.ent b/branches/ucs-3.2/doc-common/docbook/stylesheets/macros-de.ent >index 703b933..c7c2dc2 100644 >--- a/branches/ucs-3.2/doc-common/docbook/stylesheets/macros-de.ent >+++ b/branches/ucs-3.2/doc-common/docbook/stylesheets/macros-de.ent >@@ -25,7 +25,7 @@ > > <!ENTITY ar "->" > > >- <!ENTITY websvn "http://forge.univention.org/svn/dev/branches/ucs-3.2/ucs-3.2-0/" > >+ <!ENTITY websvn "http://forge.univention.org/svn/dev/branches/ucs-3.2/ucs-3.2-1/" > > <!ENTITY webdoc "http://docs.univention.de/" > > <!ENTITY ucsbug "https://forge.univention.org/bugzilla/show_bug.cgi?id=" > > <!ENTITY cve "http://cve.mitre.org/cgi-bin/cvename.cgi?name=" > >diff --git a/branches/ucs-3.2/doc-common/docbook/stylesheets/macros-en.ent b/branches/ucs-3.2/doc-common/docbook/stylesheets/macros-en.ent >index 80fb61c..d62d4f4 100644 >--- a/branches/ucs-3.2/doc-common/docbook/stylesheets/macros-en.ent >+++ b/branches/ucs-3.2/doc-common/docbook/stylesheets/macros-en.ent >@@ -25,7 +25,7 @@ > > <!ENTITY ar "->" > > >- <!ENTITY websvn "http://forge.univention.org/svn/dev/branches/ucs-3.2/ucs-3.2-0/" > >+ <!ENTITY websvn "http://forge.univention.org/svn/dev/branches/ucs-3.2/ucs-3.2-1/" > > <!ENTITY webdoc "http://docs.univention.de/" > > <!ENTITY ucsbug "https://forge.univention.org/bugzilla/show_bug.cgi?id=" > > <!ENTITY cve "http://cve.mitre.org/cgi-bin/cvename.cgi?name=" > >diff --git a/branches/ucs-3.2/ucs-3.2-1/doc/developer-reference/apps/app.xml b/branches/ucs-3.2/ucs-3.2-1/doc/developer-reference/apps/app.xml >index 72f7cd1..c519fea 100644 >--- a/branches/ucs-3.2/ucs-3.2-1/doc/developer-reference/apps/app.xml >+++ b/branches/ucs-3.2/ucs-3.2-1/doc/developer-reference/apps/app.xml >@@ -605,8 +605,7 @@ > <para> > A unique upload ID will be displayed after the download that has to be > forwarded to Univention. Please send the following information via e-mail >- to <email><ulink >- url="mailto:appcenter@univention.de">appcenter@univention.de</ulink></email>: >+ to <ulink url="mailto:appcenter@univention.de"><email>appcenter@univention.de</email></ulink>: > <itemizedlist> > <listitem><simpara> > Upload ID for the file archive. Please provide all upload IDs if the >@@ -697,8 +696,7 @@ > Updates for the application description (.ini file), the product logo, > the screenshot, readme files (especially > <literal>README_UPDATE</literal>) and the packages are all submitted to >- <email><ulink >- url="mailto:appcenter@univention.de">appcenter@univention.de</ulink></email>. >+ <ulink url="mailto:appcenter@univention.de"><email>appcenter@univention.de</email></ulink>. > Only those files that changed need to be uploaded again, everything else > can be copied by Univention. The ini file needs to change every time, > because the <literal>Version</literal> has to be increased. If this is >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/introduction.xml b/branches/ucs-3.2/ucs-3.2-1/doc/developer-reference/introduction.xml >index bdf4af7..f5b491b 100644 >--- a/branches/ucs-3.2/ucs-3.2-1/doc/developer-reference/introduction.xml >+++ b/branches/ucs-3.2/ucs-3.2-1/doc/developer-reference/introduction.xml >@@ -13,7 +13,7 @@ > > <para> > Feedback is very welcome! Please either file a bug (see <xref linkend="chap:bug"/>) or send an >- e-mail to feedback@univention.de >+ e-mail to <ulink url="mailto:feedback@univention.de"><email>feedback@univention.de</email></ulink>. > </para> > > </preface> >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..2139d7e 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 internally uses file locking 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> >@@ -910,7 +915,8 @@ Depends: ..., ${misc:Depends}, ... > <remark>SG: Move this to a sample package</remark> > <para> > This sections contains several simple examples for the use of &ucsUCR;. >- The complete source of these examples is available separately. <!-- TODO: svn link? --> >+ The complete source of these examples is available separately. >+ The download location is given in each example below. > Since almost all &ucsUCS; packages use <acronym>UCR</acronym>, their source code provides additional examples. > </para> >
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