@@ 1184-1196 (lines=13) @@ | ||
1181 | _xmlftime.add_element('month', str(first_time_month)) |
|
1182 | _xmlftime.add_element('year', str(first_time_year)) |
|
1183 | ||
1184 | if duration: |
|
1185 | if not duration_unit: |
|
1186 | raise RequiredArgument( |
|
1187 | 'Setting duration requires duration_unit argument') |
|
1188 | ||
1189 | if not duration_unit in TIME_UNITS: |
|
1190 | raise InvalidArgument( |
|
1191 | 'duration_unit must be one of {units} but {actual} has ' |
|
1192 | 'been passed'.format( |
|
1193 | units=', '.join(TIME_UNITS), actual=duration_unit)) |
|
1194 | ||
1195 | _xmlduration = cmd.add_element('duration', str(duration)) |
|
1196 | _xmlduration.add_element('unit', duration_unit) |
|
1197 | ||
1198 | if period: |
|
1199 | if not period_unit: |
|
@@ 4014-4026 (lines=13) @@ | ||
4011 | _xmlftime.add_element('month', str(first_time_month)) |
|
4012 | _xmlftime.add_element('year', str(first_time_year)) |
|
4013 | ||
4014 | if duration: |
|
4015 | if not duration_unit: |
|
4016 | raise RequiredArgument( |
|
4017 | 'Setting duration requires duration_unit argument') |
|
4018 | ||
4019 | if not duration_unit in TIME_UNITS: |
|
4020 | raise InvalidArgument( |
|
4021 | 'duration_unit must be one of {units} but {actual} has ' |
|
4022 | 'been passed'.format( |
|
4023 | units=', '.join(TIME_UNITS), actual=duration_unit)) |
|
4024 | ||
4025 | _xmlduration = cmd.add_element('duration', str(duration)) |
|
4026 | _xmlduration.add_element('unit', duration_unit) |
|
4027 | ||
4028 | if period: |
|
4029 | if not period_unit: |