author | Tero Marttila <terom@fixme.fi> |
Thu, 02 Apr 2009 22:52:26 +0300 | |
changeset 4 | 8b633782f02d |
parent 2 | e66102ab7048 |
permissions | -rw-r--r-- |
1
2223ade4f259
continue the overengineering effort, we are now able to generate dhcpd.conf files
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
1 |
""" |
2223ade4f259
continue the overengineering effort, we are now able to generate dhcpd.conf files
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
2 |
Functions to load data from various sources |
2223ade4f259
continue the overengineering effort, we are now able to generate dhcpd.conf files
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
3 |
""" |
2223ade4f259
continue the overengineering effort, we are now able to generate dhcpd.conf files
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
4 |
|
2223ade4f259
continue the overengineering effort, we are now able to generate dhcpd.conf files
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
5 |
import imp |
2223ade4f259
continue the overengineering effort, we are now able to generate dhcpd.conf files
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
6 |
|
2
e66102ab7048
fix up data.load_py, and make conf.File be a ConfObject itself - implement this for dhcp_conf
Tero Marttila <terom@fixme.fi>
parents:
1
diff
changeset
|
7 |
def load_py (name, path) : |
1
2223ade4f259
continue the overengineering effort, we are now able to generate dhcpd.conf files
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
8 |
""" |
2
e66102ab7048
fix up data.load_py, and make conf.File be a ConfObject itself - implement this for dhcp_conf
Tero Marttila <terom@fixme.fi>
parents:
1
diff
changeset
|
9 |
Load a python file from the given filesystem path, returning the module itself. |
e66102ab7048
fix up data.load_py, and make conf.File be a ConfObject itself - implement this for dhcp_conf
Tero Marttila <terom@fixme.fi>
parents:
1
diff
changeset
|
10 |
|
e66102ab7048
fix up data.load_py, and make conf.File be a ConfObject itself - implement this for dhcp_conf
Tero Marttila <terom@fixme.fi>
parents:
1
diff
changeset
|
11 |
The "name" of the module must be given, it should be something sane and unique... |
1
2223ade4f259
continue the overengineering effort, we are now able to generate dhcpd.conf files
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
12 |
""" |
2223ade4f259
continue the overengineering effort, we are now able to generate dhcpd.conf files
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
13 |
|
2
e66102ab7048
fix up data.load_py, and make conf.File be a ConfObject itself - implement this for dhcp_conf
Tero Marttila <terom@fixme.fi>
parents:
1
diff
changeset
|
14 |
# just load it and return |
e66102ab7048
fix up data.load_py, and make conf.File be a ConfObject itself - implement this for dhcp_conf
Tero Marttila <terom@fixme.fi>
parents:
1
diff
changeset
|
15 |
return imp.load_source(name, path) |
1
2223ade4f259
continue the overengineering effort, we are now able to generate dhcpd.conf files
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
16 |