Convert a datetime to a PDF string representing it. Used for PDF and PGF.
(d)
| 201 | |
| 202 | |
| 203 | def _datetime_to_pdf(d): |
| 204 | """ |
| 205 | Convert a datetime to a PDF string representing it. |
| 206 | |
| 207 | Used for PDF and PGF. |
| 208 | """ |
| 209 | r = d.strftime('D:%Y%m%d%H%M%S') |
| 210 | z = d.utcoffset() |
| 211 | if z is not None: |
| 212 | z = z.seconds |
| 213 | else: |
| 214 | if time.daylight: |
| 215 | z = time.altzone |
| 216 | else: |
| 217 | z = time.timezone |
| 218 | if z == 0: |
| 219 | r += 'Z' |
| 220 | elif z < 0: |
| 221 | r += "+%02d'%02d'" % ((-z) // 3600, (-z) % 3600) |
| 222 | else: |
| 223 | r += "-%02d'%02d'" % (z // 3600, z % 3600) |
| 224 | return r |
| 225 | |
| 226 | |
| 227 | def _calculate_quad_point_coordinates(x, y, width, height, angle=0): |
no outgoing calls
no test coverage detected
searching dependent graphs…