FAQ What is a .pml file?
From DANSE
A .pml file is an XML file that assigns values to properties, components, and facilities in an application, allowing a user to override the default values assigned in the respective inventories.
The name of the .pml file must be <applicationName>.pml.
Empty pml files can be generated using the inventory.py script distributed with pyre. For example, to generate a pml file for the application named "test",
$ python inventory.py --name=test creating inventory template in 'test.pml'
generates a file containing this:
<?xml version="1.0"?>
<!--
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
! T. M. Kelley
! (C) Copyright 2005 All Rights Reserved
!
! {LicenseText}
!
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!DOCTYPE inventory>
<inventory>
<component name='test'>
<property name='key'>value</property>
</component>
</inventory>
<!-- version-->
<!-- $Id$-->
<!-- Generated automatically by XMLMill on Tue Apr 12 17:36:35 2005-->
<!-- End of file -->
By editing this file one can change the properties of the application named "test". For instance, suppose test has a property named "property1", and you want to set it to 3.14159. You could edit the line
<property name='key'>value</property>
to read
<property name='property1'>3.14159</property>.
See also where to put .pml files
change the choice of a component
Say if we have a greeter component in our hello application
class Hello(Script):
class Inventory(Script.Inventory):
greeter = pyre.inventory.facility( 'greeter', default = Greeter('greeter') )
...
And we want to change the default choice of greeter to a odb file called morning.odb
#morning.odb
from Greeter import Greeter
def greeter():
from Greeter import Greeter
class Morning (Greeter):
def _defaults(self): self.inventory.greeting = "Good morning"
return Morning('morning')
What we could do is to change the application pml file hello.pml
<component name='hello'> <facility name='greeter'>morning</facility> </component>
