Skip to content

Commit 222ce8b

Browse files
committed
Merge remote-tracking branch 'archive/master'
Contains release 0.2.1 that was not migrated from gitorious for some reason.
2 parents 626428e + a030e91 commit 222ce8b

3 files changed

Lines changed: 22 additions & 6 deletions

File tree

doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
# built documents.
4646
#
4747
# The short X.Y version.
48-
version = '0.2'
48+
version = '0.2.1'
4949
# The full version, including alpha/beta/rc tags.
50-
release = '0.2'
50+
release = '0.2.1'
5151

5252
# The language for content autogenerated by Sphinx. Refer to documentation
5353
# for a list of supported languages.

gdsii/record.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright © 2010 Eugeniy Meshcheryakov <eugen@debian.org>
3+
# Copyright © 2010-2012 Eugeniy Meshcheryakov <eugen@debian.org>
44
#
55
# This program is free software: you can redistribute it and/or modify
66
# it under the terms of the GNU Lesser General Public License as published by
@@ -521,11 +521,27 @@ def times(self):
521521
Traceback (most recent call last):
522522
...
523523
DataSizeError: 258
524+
>>> # invalid day/month/etc
525+
>>> r = r = Record(tags.BGNLIB, [100, 0, 1, 1, 2, 3, 110, 8, 32, 21, 10, 35])
526+
>>> print(r.times[0].isoformat())
527+
1900-01-01T00:00:00
528+
>>> print(r.times[1].isoformat())
529+
1900-01-01T00:00:00
524530
"""
525531
if len(self.data) != 12:
526532
raise exceptions.DataSizeError(self.tag)
527-
return (datetime(self.data[0]+1900, *self.data[1:6]),
528-
datetime(self.data[6]+1900, *self.data[7:12]))
533+
534+
try:
535+
mod_time = datetime(self.data[0]+1900, *self.data[1:6])
536+
except ValueError:
537+
mod_time = datetime(1900, 1, 1, 0, 0, 0)
538+
539+
try:
540+
acc_time = datetime(self.data[6]+1900, *self.data[7:12])
541+
except ValueError:
542+
acc_time = datetime(1900, 1, 1, 0, 0, 0)
543+
544+
return mod_time, acc_time
529545

530546
@property
531547
def acls(self):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name = 'python-gdsii',
15-
version = '0.2',
15+
version = '0.2.1',
1616
description = 'GDSII manipulation libaray',
1717
long_description = long_desc,
1818
author = 'Eugeniy Meshcheryakov',

0 commit comments

Comments
 (0)