|
@@ 1088-1100 (lines=13) @@
|
| 1085 |
|
_xmlftime.add_element('month', str(first_time_month)) |
| 1086 |
|
_xmlftime.add_element('year', str(first_time_year)) |
| 1087 |
|
|
| 1088 |
|
if duration: |
| 1089 |
|
if not duration_unit: |
| 1090 |
|
raise RequiredArgument( |
| 1091 |
|
'Setting duration requires duration_unit argument') |
| 1092 |
|
|
| 1093 |
|
if not duration_unit in TIME_UNITS: |
| 1094 |
|
raise InvalidArgument( |
| 1095 |
|
'duration_unit must be one of {units} but {actual} has ' |
| 1096 |
|
'been passed'.format( |
| 1097 |
|
units=', '.join(TIME_UNITS), actual=duration_unit)) |
| 1098 |
|
|
| 1099 |
|
_xmlduration = cmd.add_element('duration', str(duration)) |
| 1100 |
|
_xmlduration.add_element('unit', duration_unit) |
| 1101 |
|
|
| 1102 |
|
if period: |
| 1103 |
|
if not period_unit: |
|
@@ 3772-3784 (lines=13) @@
|
| 3769 |
|
_xmlftime.add_element('month', str(first_time_month)) |
| 3770 |
|
_xmlftime.add_element('year', str(first_time_year)) |
| 3771 |
|
|
| 3772 |
|
if duration: |
| 3773 |
|
if not duration_unit: |
| 3774 |
|
raise RequiredArgument( |
| 3775 |
|
'Setting duration requires duration_unit argument') |
| 3776 |
|
|
| 3777 |
|
if not duration_unit in TIME_UNITS: |
| 3778 |
|
raise InvalidArgument( |
| 3779 |
|
'duration_unit must be one of {units} but {actual} has ' |
| 3780 |
|
'been passed'.format( |
| 3781 |
|
units=', '.join(TIME_UNITS), actual=duration_unit)) |
| 3782 |
|
|
| 3783 |
|
_xmlduration = cmd.add_element('duration', str(duration)) |
| 3784 |
|
_xmlduration.add_element('unit', duration_unit) |
| 3785 |
|
|
| 3786 |
|
if period: |
| 3787 |
|
if not period_unit: |