View | Details | Raw Unified | Return to bug 32743 | Differences between
and this patch

Collapse All | Expand All

(-)a/branches/ucs-3.2/ucs-3.2-1/doc/developer-reference/developer-reference-3.2.xml (-2 / +2 lines)
 Lines 33-40    Link Here 
33
		</legalnotice>
33
		</legalnotice>
34
		<revhistory>
34
		<revhistory>
35
			<revision>
35
			<revision>
36
				<revnumber>3.2-0</revnumber>
36
				<revnumber>3.2-1</revnumber>
37
				<date>19th of November 2013</date>
37
				<date>17th of March 2014</date>
38
			</revision>
38
			</revision>
39
		</revhistory>
39
		</revhistory>
40
	</bookinfo>
40
	</bookinfo>
(-)a/branches/ucs-3.2/ucs-3.2-1/doc/developer-reference/ucr/ucr.xml (-8 / +13 lines)
 Lines 203-223   if ucr.is_false('repository/online/unmaintained', True): Link Here 
203
			</example>
203
			</example>
204
			<para>
204
			<para>
205
				Modifying variables requires a different approach.
205
				Modifying variables requires a different approach.
206
				Two functions <function>handler_set()</function> and <function>handler_unset()</function> can be used to set and unset variables.
206
				The function <function>ucr_update()</function> should be used to set and unset variables.
207
			</para>
207
			</para>
208
			<example>
208
			<example>
209
				<title>Changing &ucsUCRV;s in Python</title>
209
				<title>Changing &ucsUCRV;s in Python</title>
210
				<programlisting><![CDATA[
210
				<programlisting><![CDATA[
211
from univention.config_registry import handler_set, handler_unset
211
from univention.config_registry.handler import ucr_update
212
handler_set([
212
ucr_update(ucr, {
213
	'foo=bar',
213
	'foo': 'bar',
214
	'baz=42',
214
	'baz': '42',
215
	])
215
	'bar': None,
216
handler_unset(['foo', 'bar'])
216
	})
217
				]]></programlisting>
217
				]]></programlisting>
218
			</example>
218
			</example>
219
			<para>
219
			<para>
220
				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.
220
				The function <function>ucr_update()</function> requires an instance of <classname>ConfigRegistry</classname> as its first argument.
221
				The method is guaranteed to be atomic and uses file locking internally to prevent race conditions.
222
			</para>
223
			<para>
224
				The second argument must be a Python dictionary mapping <acronym>UCR</acronym> variable names to their new value.
225
				The value must be either a string or <constant>None</constant>, which is used to unset the variable.
221
			</para>
226
			</para>
222
		</section>
227
		</section>
223
	</section>
228
	</section>

Return to bug 32743