# Path: nrcif/fields.py
# class TextField(CIFField):
#     '''Represents a CIF field simply stored as text'''
# 
#     py_type = str
# 
#     def __init__(self, name, width):
#         self.name = name
#         self.width = width
#         self.sql_type = "CHAR({})".format(width)
# 
# class IntegerField(CIFField):
#     '''Represents a CIF field simply stored as an integer'''
# 
#     sql_type = "INTEGER"
#     py_type = int
# 
#     def __init__(self, name, width, optional=False):
#         self.name = name
#         self.width = width
#         self.optional = optional
# 
#     def read(self, text):
#         if self.optional and text.isspace():
#             return None
#         else:
#             return int(text)
# 
# class VarTextField(CIFField):
#     '''Represents a CIF field simply stored as text'''
# 
#     py_type = str
# 
#     def __init__(self, name, width):
#         self.name = name
#         self.width = width
#         self.sql_type = "VARCHAR({})".format(width)


from nrcif.fields import TextField, IntegerField, VarTextField
import nrcif.mockdb

#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#  MA 02110-1301, USA.
#

'''tsi_reader - Read ATOC TOC Specific Interchange times

This module reads data from a TSI file from ATOC containing additional
information on the interchange times between train companies at certain
TOCs (for example, where a particular company has its own set of
platforms at some distance from the others.'''



class TSI(object):
    '''A simple hander for TSI files.'''

    layout = [TextField("Station code", 3),

# Path: nrcif/fields.py
# class TextField(CIFField):
#     '''Represents a CIF field simply stored as text'''
# 
#     py_type = str
# 
#     def __init__(self, name, width):
#         self.name = name
#         self.width = width
#         self.sql_type = "CHAR({})".format(width)
# 
# class IntegerField(CIFField):
#     '''Represents a CIF field simply stored as an integer'''
# 
#     sql_type = "INTEGER"
#     py_type = int
# 
#     def __init__(self, name, width, optional=False):
#         self.name = name
#         self.width = width
#         self.optional = optional
# 
#     def read(self, text):
#         if self.optional and text.isspace():
#             return None
#         else:
#             return int(text)
# 
# class VarTextField(CIFField):
#     '''Represents a CIF field simply stored as text'''
# 
#     py_type = str
# 
#     def __init__(self, name, width):
#         self.name = name
#         self.width = width
#         self.sql_type = "VARCHAR({})".format(width)


# Path: nrcif/tsi_reader.py
from nrcif.fields import TextField, IntegerField, VarTextField
import nrcif.mockdb


#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#  MA 02110-1301, USA.
#

'''tsi_reader - Read ATOC TOC Specific Interchange times

This module reads data from a TSI file from ATOC containing additional
information on the interchange times between train companies at certain
TOCs (for example, where a particular company has its own set of
platforms at some distance from the others.'''



class TSI(object):
    '''A simple hander for TSI files.'''

    layout = [TextField("Station code", 3),

              TextField("Arriving train TOC", 2),