pydoop.jc — Pydoop Script Configuration Access — Pydoop 0.10.0_rc1 documentation

### Navigation

- index
- modules |
- next |
- previous |
- Home|
- Download & Install|
- Support|
- Pydoop on SF
- API Docs »

# `pydoop.jc` — Pydoop Script Configuration Access

Provides a wrapper for the JobConf object.

class `pydoop.jc.` `jc_wrapper`(jc)

  Simple JobConf wrapper to cache type-converted items.

  `jc_wrapper[k]`

    Use the `[]` operator to get the original conf string value for property `k`.

    Parameters: | k – name of the property.
    Raises KeyError:
    | if the requested property doesn’t exist.

  `get`(k, default=None)

    Return the original conf string, if `k` exists in the configuration. Else return the value of the argument default.

    Parameters: | k – name of the property. default – value to return if the requested property doesn’t exist.

  `get_boolean`(k, default=False)

    Fetch the property named `k` and convert it to a `bool`.

    The values ‘t’, ‘true’, and ‘1’ (upper or lower case) are accepted for True. Similarly, ‘f’, ‘false’ and ‘0’ are accepted for False.

    Parameters: | k – name of the property. default – value to return if the requested property doesn’t exist.
    Raises ValueError:
    | if the value can’t be converted to a `bool`.

  `get_float`(k, default=0.0)

    Fetch the property named `k` and convert it to a `float`.

    Parameters: | k – name of the property. default – value to return if the requested property doesn’t exist.
    Raises ValueError:
    | if the value can’t be converted to a `float`.

  `get_int`(k, default=0)

    Fetch the property named `k` and convert it to an `int`.

    Parameters: | k – name of the property. default – value to return if the requested property doesn’t exist.
    Raises ValueError:
    | if the value can’t be converted to an `int`.

  `has_key`(k)

    Test for the presence of the property `k` in the configuration.

    Parameters: | k – name of the property.

### Navigation

- index
- modules |
- next |
- previous |
- Home|
- Download & Install|
- Support|
- Pydoop on SF
- API Docs »