|
@@ 3911-3923 (lines=13) @@
|
| 3908 |
|
_xmlftime.add_element('month', str(first_time_month)) |
| 3909 |
|
_xmlftime.add_element('year', str(first_time_year)) |
| 3910 |
|
|
| 3911 |
|
if duration: |
| 3912 |
|
if not duration_unit: |
| 3913 |
|
raise RequiredArgument( |
| 3914 |
|
'Setting duration requires duration_unit argument') |
| 3915 |
|
|
| 3916 |
|
if not duration_unit in TIME_UNITS: |
| 3917 |
|
raise InvalidArgument( |
| 3918 |
|
'duration_unit must be one of {units} but {actual} has ' |
| 3919 |
|
'been passed'.format( |
| 3920 |
|
units=', '.join(TIME_UNITS), actual=duration_unit)) |
| 3921 |
|
|
| 3922 |
|
_xmlduration = cmd.add_element('duration', str(duration)) |
| 3923 |
|
_xmlduration.add_element('unit', duration_unit) |
| 3924 |
|
|
| 3925 |
|
if period: |
| 3926 |
|
if not period_unit: |
|
@@ 1104-1116 (lines=13) @@
|
| 1101 |
|
_xmlftime.add_element('month', str(first_time_month)) |
| 1102 |
|
_xmlftime.add_element('year', str(first_time_year)) |
| 1103 |
|
|
| 1104 |
|
if duration: |
| 1105 |
|
if not duration_unit: |
| 1106 |
|
raise RequiredArgument( |
| 1107 |
|
'Setting duration requires duration_unit argument') |
| 1108 |
|
|
| 1109 |
|
if not duration_unit in TIME_UNITS: |
| 1110 |
|
raise InvalidArgument( |
| 1111 |
|
'duration_unit must be one of {units} but {actual} has ' |
| 1112 |
|
'been passed'.format( |
| 1113 |
|
units=', '.join(TIME_UNITS), actual=duration_unit)) |
| 1114 |
|
|
| 1115 |
|
_xmlduration = cmd.add_element('duration', str(duration)) |
| 1116 |
|
_xmlduration.add_element('unit', duration_unit) |
| 1117 |
|
|
| 1118 |
|
if period: |
| 1119 |
|
if not period_unit: |