-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
46 lines (33 loc) · 1.48 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
python-webmin - Python implementation of the Webmin API
=======================================================
python-webmin is an implementation of the Webmin API. By using
python-webmin, you can write Webmin modules in Python instead of Perl.
python-webmin is a young project and the code probably has many
bugs. Currently, about 25 per cent of the API is implemented. This is
sufficient to write basic modules.
For up-to-date information about python-webmin, take a look at
http://www.cendio.se/~peter/python-webmin/.
Requirements
------------
Python 2.2 (or newer) is required.
Various notes
-------------
Since there is nothing like $main::no_acl_check in Python, you should
set variables in the webmin module instead. So, instead of doing:
$no_acl_check++;
you should do:
import webmin
webmin.no_acl_check = 1
Webmin uses a variable called "in". This is a keyword in Python, so it
is changed to "indata".
Webmin does not allow a function and variable to have the same
name. Therefore, the text substitution function is called "textsub"
rather than "text".
Non-public functions are prefixed with underscore.
In Perl, referencing an associative array with an unknown key does not
produce any error but rather gives a empty result. This is not true in
Python. Therefore, it often makes sense to do
somedictionary.get("somekey", "") instead of
somedictionary["somekey"]. However, this method is not used for
translations via the "text" dictionary: We want to notice when a
translation is missing.