|
@@ 3978-3990 (lines=13) @@
|
| 3975 |
|
_xmlftime.add_element('month', str(first_time_month)) |
| 3976 |
|
_xmlftime.add_element('year', str(first_time_year)) |
| 3977 |
|
|
| 3978 |
|
if duration: |
| 3979 |
|
if not duration_unit: |
| 3980 |
|
raise RequiredArgument( |
| 3981 |
|
'Setting duration requires duration_unit argument') |
| 3982 |
|
|
| 3983 |
|
if not duration_unit in TIME_UNITS: |
| 3984 |
|
raise InvalidArgument( |
| 3985 |
|
'duration_unit must be one of {units} but {actual} has ' |
| 3986 |
|
'been passed'.format( |
| 3987 |
|
units=', '.join(TIME_UNITS), actual=duration_unit)) |
| 3988 |
|
|
| 3989 |
|
_xmlduration = cmd.add_element('duration', str(duration)) |
| 3990 |
|
_xmlduration.add_element('unit', duration_unit) |
| 3991 |
|
|
| 3992 |
|
if period: |
| 3993 |
|
if not period_unit: |
|
@@ 1148-1160 (lines=13) @@
|
| 1145 |
|
_xmlftime.add_element('month', str(first_time_month)) |
| 1146 |
|
_xmlftime.add_element('year', str(first_time_year)) |
| 1147 |
|
|
| 1148 |
|
if duration: |
| 1149 |
|
if not duration_unit: |
| 1150 |
|
raise RequiredArgument( |
| 1151 |
|
'Setting duration requires duration_unit argument') |
| 1152 |
|
|
| 1153 |
|
if not duration_unit in TIME_UNITS: |
| 1154 |
|
raise InvalidArgument( |
| 1155 |
|
'duration_unit must be one of {units} but {actual} has ' |
| 1156 |
|
'been passed'.format( |
| 1157 |
|
units=', '.join(TIME_UNITS), actual=duration_unit)) |
| 1158 |
|
|
| 1159 |
|
_xmlduration = cmd.add_element('duration', str(duration)) |
| 1160 |
|
_xmlduration.add_element('unit', duration_unit) |
| 1161 |
|
|
| 1162 |
|
if period: |
| 1163 |
|
if not period_unit: |