Project File Read from File Method

def _read(self, directory, filename, session, path, name, extension,
              spatial, spatialReferenceID, replaceParamFile,
              force_relative=True):
        """
        Project File Read from File Method
        """
        self.project_directory = directory
        with tmp_chdir(directory):
            # Headers to ignore
            HEADERS = ('GSSHAPROJECT',)

            # WMS Cards to include (don't discount as comments)
            WMS_CARDS = ('#INDEXGRID_GUID', '#PROJECTION_FILE', '#LandSoil',
                         '#CHANNEL_POINT_INPUT_WMS')

            GSSHAPY_CARDS = ('#GSSHAPY_EVENT_YML', )

            with open(path, 'r') as f:
                for line in f:
                    if not line.strip():
                        # Skip empty lines
                        continue

                    elif '#' in line.split()[0] and line.split()[0] \
                            not in WMS_CARDS + GSSHAPY_CARDS:
                        # Skip comments designated by the hash symbol
                        # (with the exception of WMS_CARDS and GSSHAPY_CARDS)
                        continue

                    try:
                        card = self._extractCard(line, force_relative)

                    except:
                        card = self._extractDirectoryCard(line, force_relative)

                    # Now that the cardName and cardValue are separated
                    # load them into the gsshapy objects
                    if card['name'] not in HEADERS:
                        # Create GSSHAPY Project Card object
                        prjCard = ProjectCard(name=card['name'], value=card['value'])

                        # Associate ProjectCard with ProjectFile
                        prjCard.projectFile = self

                        # Extract MAP_TYPE card value for convenience working
                        # with output maps
                        if card['name'] == 'MAP_TYPE':
                            self.mapType = int(card['value'])

            # Assign properties
            self.srid = spatialReferenceID
            self.name = name
            self.fileExtension = extension