Changeset 570
- Timestamp:
- Jan 23, 2007, 10:49:32 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/Rappture/PyRpUnits.cc
r508 r570 394 394 } 395 395 396 PyDoc_STRVAR(RpUnits_makeMetric_doc,397 "makeMetric (newBasis) -> PyInt \n\398 \n\399 Create the metric extentions and conversion functions for \n\400 the unit 'newBasis', thus making it a new basis.");401 402 static PyObject*403 RpUnits_makeMetric(PyObject *self, PyObject *args)404 {405 RpUnitsObject* units = NULL;406 int result = 0;407 408 if (PyTuple_Size(args) > 0) {409 PyArg_ParseTuple(args, "O!", &RpUnitsObjectType, &units);410 }411 else {412 return NULL;413 }414 415 if (units->rp_unit) {416 result = RpUnits::makeMetric(units->rp_unit);417 }418 419 return PyInt_FromLong((long)result);420 }421 422 396 PyDoc_STRVAR(RpUnits_convert_doc, 423 397 "convert (fromVal, to, units) -> PyString \n\ … … 518 492 RpUnits_find_doc}, 519 493 520 {"makeMetric", RpUnits_makeMetric, METH_VARARGS,521 RpUnits_makeMetric_doc},522 523 494 {"convert", (PyCFunction)RpUnits_convert, METH_VARARGS|METH_KEYWORDS, 524 495 RpUnits_convert_doc},
Note: See TracChangeset
for help on using the changeset viewer.