Sets a value for the timestamp element. If that elememtn does not exist, one will be created. If the timestamp argument is set to None, the timestamp will be set to the current time.
(self, timestamp)
| 646 | return None |
| 647 | |
| 648 | def setTimestamp(self, timestamp): |
| 649 | """ |
| 650 | Sets a value for the timestamp element. If that elememtn does not exist, one will be created. |
| 651 | If the timestamp argument is set to None, the timestamp will be set to the current time. |
| 652 | """ |
| 653 | if self.element is None: |
| 654 | return False |
| 655 | |
| 656 | if not timestamp or timestamp is None: |
| 657 | now = datetime.date.today() |
| 658 | timestamp = now.strftime(OvalDocument.TIME_FORMAT) |
| 659 | |
| 660 | child = self.element.find("oval:timestamp", OvalDocument.NS_OVAL) |
| 661 | if child is not None: |
| 662 | child.text = timestamp |
| 663 | else: |
| 664 | child = Element("{" + OvalDocument.NS_OVAL.get("oval") + "}timestamp") |
| 665 | child.text = timestamp |
| 666 | self.element.append(child) |
| 667 | |
| 668 | def getExtra(self, name, namespace=None): |
| 669 | """ |
no test coverage detected