|
@@ 4031-4043 (lines=13) @@
|
| 4028 |
|
_xmlftime.add_element('month', str(first_time_month)) |
| 4029 |
|
_xmlftime.add_element('year', str(first_time_year)) |
| 4030 |
|
|
| 4031 |
|
if duration: |
| 4032 |
|
if not duration_unit: |
| 4033 |
|
raise RequiredArgument( |
| 4034 |
|
'Setting duration requires duration_unit argument') |
| 4035 |
|
|
| 4036 |
|
if not duration_unit in TIME_UNITS: |
| 4037 |
|
raise InvalidArgument( |
| 4038 |
|
'duration_unit must be one of {units} but {actual} has ' |
| 4039 |
|
'been passed'.format( |
| 4040 |
|
units=', '.join(TIME_UNITS), actual=duration_unit)) |
| 4041 |
|
|
| 4042 |
|
_xmlduration = cmd.add_element('duration', str(duration)) |
| 4043 |
|
_xmlduration.add_element('unit', duration_unit) |
| 4044 |
|
|
| 4045 |
|
if period: |
| 4046 |
|
if not period_unit: |
|
@@ 1201-1213 (lines=13) @@
|
| 1198 |
|
_xmlftime.add_element('month', str(first_time_month)) |
| 1199 |
|
_xmlftime.add_element('year', str(first_time_year)) |
| 1200 |
|
|
| 1201 |
|
if duration: |
| 1202 |
|
if not duration_unit: |
| 1203 |
|
raise RequiredArgument( |
| 1204 |
|
'Setting duration requires duration_unit argument') |
| 1205 |
|
|
| 1206 |
|
if not duration_unit in TIME_UNITS: |
| 1207 |
|
raise InvalidArgument( |
| 1208 |
|
'duration_unit must be one of {units} but {actual} has ' |
| 1209 |
|
'been passed'.format( |
| 1210 |
|
units=', '.join(TIME_UNITS), actual=duration_unit)) |
| 1211 |
|
|
| 1212 |
|
_xmlduration = cmd.add_element('duration', str(duration)) |
| 1213 |
|
_xmlduration.add_element('unit', duration_unit) |
| 1214 |
|
|
| 1215 |
|
if period: |
| 1216 |
|
if not period_unit: |