pyslha.py

changeset 204
bef82eaef56e
parent 203
ce90a0dace07
child 205
536967068fe2
     1.1 --- a/pyslha.py	Sun Apr 28 22:13:19 2013 +0200
     1.2 +++ b/pyslha.py	Sun Apr 28 22:15:24 2013 +0200
     1.3 @@ -20,7 +20,6 @@
     1.4  TODOs:
     1.5  
     1.6  For 2.0.0:
     1.7 - * Provide a Block constructor that takes a dict of entries
     1.8   * Output column alignment cosmetics
     1.9   * Precision setting obedience in SLHA output of values
    1.10  
    1.11 @@ -113,9 +112,11 @@
    1.12      method may be used to set it if only one argument is supplied and the object
    1.13      is compatible.
    1.14      """
    1.15 -    def __init__(self, name, q=None):
    1.16 +    def __init__(self, name, q=None, entries=None):
    1.17          self.name = name
    1.18          self.entries = _mkdict()
    1.19 +        if entries is not None:
    1.20 +            self.entries.update(entries)
    1.21          self.q = _autotype(q)
    1.22  
    1.23      def add_entry(self, entry):

mercurial