Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(36)  |  Call(28)  |  Derive(0)  |  Import(8)
This class is used to communicate Wrangler errors.

src/t/a/TAutils-HEAD/wrangler/Network.py   TAutils(Download)
import os, re, string, subprocess, sys, tempfile
from .Logger import WranglerLogger
from .NetworkException import NetworkException
from .Regexes import git_commit_pattern, tag_num_pattern
 
        """
        if champVersion not in ["4.3", "pre4.3"]:
            raise NetworkException("Do not understand champVersion %s")
 
        self.champVersion = champVersion
                (retcode, retstdout, retstderr) = self._runAndLog(cmd, gitdir)
                if retcode != 0:
                    raise NetworkException("Git checkout failed; see log file")
 
        if self.champVersion == "4.3":
            if projChampVersion == "pre4.3":
                raise NetworkException("Trying to use a pre4.3 network project (%s) to build a Champ4.3 network" % 
                if tag and (not tags or tag not in tags):
                    # TODO: just checkout to the new tag
                    raise NetworkException("Conflicting tag requirements - FIXME!")
 
                self.checkProjectVersion(parentdir=tempdir, networkdir=networkdir,

src/t/a/TAutils-HEAD/wrangler/TransitCapacity.py   TAutils(Download)
import copy,csv,os,re,string
from .NetworkException import NetworkException
 
__all__ = ['TransitCapacity']
 
 
        if vehicleType not in self.vehicleTypeToCapacity:
            raise NetworkException("Vehicle type [%s] of system [%s] characteristics unknown; line name = [%s]" % (vehicleType, system, linename.upper()))
 
        capacity = self.vehicleTypeToCapacity[vehicleType]
        (system, vehicleType) = self.getSystemAndVehicleType(linename, timeperiod)
        if vehicleType not in self.vehicleTypeToDelays:
            raise NetworkException("Vehicle type [%s] of system [%s] simple dwell unknown; line name = [%s]" % (vehicleType, system, linename.upper()))
 
        return self.vehicleTypeToDelays[vehicleType][TransitCapacity.DELAY_SIMPLE]
        (system, vehicleType) = self.getSystemAndVehicleType(linename, timeperiod)
        if vehicleType not in self.vehicleTypeToDelays:
            raise NetworkException("Vehicle type [%s] of system [%s] simple dwell unknown; line name = [%s]" % (vehicleType, system, linename.upper()))
 
        return (self.vehicleTypeToDelays[vehicleType][TransitCapacity.DELAY_CONST],
        """
        if templateLine not in self.linenameToAttributes:
            raise NetworkException("addLinename with unknown templateLine %s for %s" % (templateLine, newLine))
 
        self.linenameToAttributes[newLine] = copy.deepcopy(self.linenameToAttributes[templateLine])

src/t/a/TAutils-HEAD/wrangler/TransitNetwork.py   TAutils(Download)
from .Logger import WranglerLogger
from .Network import Network
from .NetworkException import NetworkException
from .PNRLink import PNRLink
from .Regexes import nodepair_pattern
        if basenetworkpath and isTiered:
            if not networkName:
                raise NetworkException("Cannot initialize tiered TransitNetwork with basenetworkpath %s: no networkName specified" % basenetworkpath)
 
            for filename in glob.glob(os.path.join(basenetworkpath, networkName + ".*")):
                allLines.append(self.lines[i])
            return allLines
        raise NetworkException('Line name not found: %s' % (name,))
 
    def splitLinkInTransitLines(self,nodeA,nodeB,newNode,stop=False):
            longLineInst=self.line(longLine)
        except:
            raise NetworkException('Unknown Route!  %s' % (longLine))
        try: 
            shortLineInst=self.line(shortLine)
        except:
            raise NetworkException('Unknown Route!  %s' % (shortLine))       

src/t/a/TAutils-HEAD/wrangler/TransitAssignmentData.py   TAutils(Download)
from .TransitLine import TransitLine
from .Logger import WranglerLogger
from .NetworkException import NetworkException
from collections import defaultdict
 
                    if int(row[self.colnameToCsvIndex["A"]])<100000:
                        if dbfRow["A"]!=int(row[self.colnameToCsvIndex["A"]]):
                            raise NetworkException("Assertion error for A on row %d: %s != %s" % (oldrownum-1, str(dbfRow["A"]), str(row[self.colnameToCsvIndex["A"]])))
                    if int(row[self.colnameToCsvIndex["B"]])<100000:
                        if dbfRow["B"]!=int(row[self.colnameToCsvIndex["B"]]):
                            raise NetworkException("Assertion error for B on row %d: %s != %s" % (oldrownum-1, str(dbfRow["B"]), str(row[self.colnameToCsvIndex["B"]])))
                    if int(row[self.colnameToCsvIndex["A"]])<100000:
                        if dbfRow["A"]!=int(row[self.colnameToCsvIndex["A"]]):
                            raise NetworkException("Assertion error for A on row %d: %s != %s" % (oldrownum-1, str(dbfRow["A"]), str(row[self.colnameToCsvIndex["A"]])))
                    if int(row[self.colnameToCsvIndex["B"]])<100000:
                        if dbfRow["B"]!=int(row[self.colnameToCsvIndex["B"]]):
                            raise NetworkException("Assertion error for B on row %d: %s != %s" % (oldrownum-1, str(dbfRow["B"]), str(row[self.colnameToCsvIndex["B"]])))

src/t/a/TAutils-HEAD/wrangler/TransitLine.py   TAutils(Download)
import copy
from .NetworkException import NetworkException
from .Node import Node
from .Logger import WranglerLogger
 
    def setFreqs(self, freqs):
        """
        Set all five headways (AM,MD,PM,EV,EA).  *freqs* must be a list of five strings.
        """
        if not len(freqs)==5: raise NetworkException('Must specify all 5 frequencies')
        elif timeperiod=="EA":
            return float(self.attr["FREQ[5]"])
        raise NetworkException("getFreq() received invalid timeperiod "+str(timeperiod))
 
    def vehiclesPerPeriod(self, timeperiod):
        """
        if not self.hasLink(nodeA,nodeB):
            raise NetworkException( "Line %s Doesn't have that link - so can't split it" % (self.name))
        newNode = Node(newNodeNum)
        if stop==True: newNode.setStop(True)

src/t/a/TAutils-HEAD/wrangler/Supplink.py   TAutils(Download)
from .NetworkException import NetworkException
 
__all__ = ['Supplink']
 
class Supplink(dict):
 
        if not self.mode:
            raise NetworkException("Supplink mode not set: " + str(self))
 
    def isWalkAccess(self):

src/t/a/TAutils-HEAD/wrangler/HighwayNetwork.py   TAutils(Download)
from .Logger import WranglerLogger
from .Network import Network
from .NetworkException import NetworkException
 
__all__ = ['HighwayNetwork']
        if cuberet != 0 and cuberet != 1:
            WranglerLogger.fatal("FAIL! Project: "+applyScript)
            raise NetworkException("HighwayNetwork applyProject failed; see log file")
 
        # move it back

src/t/a/TAutils-HEAD/wrangler/__init__.py   TAutils(Download)
from .Linki import Linki
from .Network import Network
from .NetworkException import NetworkException
from .PNRLink import PNRLink
from .Supplink import Supplink