Beispiel #1
0
 def setStartISO(self, isoTimeString):
     self.starttime = parseISOdateTime(isoTimeString)
Beispiel #2
0
 def setStartISO(self, isoTimeString):
     self.starttime = parseISOdateTime(isoTimeString)
Beispiel #3
0
def parseArgs():
    import sys
    from optparse import OptionParser

    parser = OptionParser()
    parser.add_option(
        "-i",
        "--input",
        dest="infile",
        action="store",
        type="string",
        default="-",
        help=
        "read schedule from the specified file, or stdin if '-' or not specified",
        metavar="FILE")

    parser.add_option(
        "-s",
        "--service",
        dest="servicefile",
        action="store",
        type="string",
        default=None,
        help=r'the service file defining service ID and default descriptors,',
        metavar="FILE")

    parser.add_option(
        "-g",
        "--generalconfig",
        dest="configfile",
        action="store",
        type="string",
        default=None,
        help="read service and general mux config from the specified file",
        metavar="FILE")

    parser.add_option(
        "-p",
        "--present-following",
        dest="pf_outfile",
        action="store",
        type="string",
        default=None,
        help="destination filename for present-following table sections",
        metavar="FILE")

    parser.add_option("-c",
                      "--schedule",
                      dest="sch_outfile",
                      action="store",
                      type="string",
                      default=None,
                      help="destination filename for schedule table sections",
                      metavar="FILE")

    parser.add_option(
        "-t",
        "--tableversion",
        dest="version",
        action="store",
        type="int",
        default=None,
        help="the version number to use for the table",
    )

    parser.add_option(
        "-n",
        "--timenow",
        dest="timenow",
        action="store",
        type="string",
        default=None,
        help=
        "Datetime in ISO format YYYY-MM-DDTHH:MM:SS (must be exactly this format)",
    )

    parser.add_option(
        "-m",
        "--mux",
        dest="mux",
        action="store_true",
        default=False,
        help=
        "Optional. Set to output a transport stream containing sections in ts packets of pid 0x12",
    )

    (options, args) = parser.parse_args()

    if options.servicefile is None:
        sys.stderr.write(
            "You must specify the service description file (option '-s')\n")
        sys.exit(1)

    if options.configfile is None:
        sys.stderr.write(
            "You must specify the global config file (option '-c')\n")
        sys.exit(1)

    if options.timenow is None:
        sys.stderr.write(
            "You must specify time for which schedule/pf is built (option '-n')\n"
        )
        sys.exit(1)

    options.timenow = parseISOdateTime(options.timenow)

    return options
Beispiel #4
0
def parseArgs():
    import sys
    from optparse import OptionParser
    
    parser = OptionParser()
    parser.add_option("-i", "--input", dest="infile",
        action="store", type="string", default="-",
        help="read schedule from the specified file, or stdin if '-' or not specified",
        metavar="FILE")
    
    parser.add_option("-s", "--service", dest="servicefile",
        action="store", type="string", default=None,
        help=r'the service file defining service ID and default descriptors,',
        metavar="FILE")
        
    parser.add_option("-g", "--generalconfig", dest="configfile",
        action="store", type="string", default=None,
        help="read service and general mux config from the specified file",
        metavar="FILE")
        
    parser.add_option("-p", "--present-following", dest="pf_outfile",
        action="store", type="string", default=None,
        help="destination filename for present-following table sections",
        metavar="FILE")

    parser.add_option("-c", "--schedule", dest="sch_outfile",
        action="store", type="string", default=None,
        help="destination filename for schedule table sections",
        metavar="FILE")

    parser.add_option("-t", "--tableversion", dest="version",
        action="store", type="int", default=None,
        help="the version number to use for the table",
        )
        
    parser.add_option("-n", "--timenow", dest="timenow",
        action="store", type="string", default=None,
        help="Datetime in ISO format YYYY-MM-DDTHH:MM:SS (must be exactly this format)",
        )
        
    parser.add_option("-m", "--mux", dest="mux",
        action="store_true", default=False,
        help="Optional. Set to output a transport stream containing sections in ts packets of pid 0x12",
        )
        
    (options, args) = parser.parse_args()
    
    if options.servicefile is None:
        sys.stderr.write("You must specify the service description file (option '-s')\n")
        sys.exit(1)
        
    if options.configfile is None:
        sys.stderr.write("You must specify the global config file (option '-c')\n")
        sys.exit(1)
        
    if options.timenow is None:
        sys.stderr.write("You must specify time for which schedule/pf is built (option '-n')\n")
        sys.exit(1)
        
    options.timenow = parseISOdateTime(options.timenow)

    return options