Пример #1
0
def ParseOpts():
    o = argparse.ArgumentParser()
    outdir = devenv.GetAppFolder(iconrendering.APPNAME)
    o.add_argument('outfolder',
                   help='Output folder relative to output root directory.')
    choices = [
        iec.DO_RENDER_ALL, iec.DO_RENDER_ICONS, iec.DO_RENDER_RENDERS,
        iec.DO_RENDER_TYPES32, iec.DO_RENDER_TYPES64
    ]
    o.add_argument('imagebatch',
                   choices=choices,
                   help='Specify which part of the iec to render/generate.')
    o.add_argument(
        '--removedir',
        default=False,
        action='store_true',
        help='Remove/replace destination folder if it already exists.')
    o.add_argument('--outroot',
                   default=outdir,
                   help='Root output directory. Defaults to %s' % outdir)
    o.add_argument('--debug', default=DEBUG, help='Output debug information.')
    o.add_argument(
        '--takeonly',
        type=int,
        help='Only render this many of each type. Useful when debugging.')
    o.add_argument(
        '--branch',
        type=int,
        default=3,
        help=
        'BranchID for static data versioning. 1=DEV, 2=STAGING, 3=RELEASE, 301=DEVDEMO. Defaults to 3. See zstatic.branches.'
    )
    return o.parse_args()
Пример #2
0
def GetTimestampedFilename2(appname,
                            basename=None,
                            ext='.log',
                            fmt='%Y-%m-%d-%H-%M-%S',
                            timestruct=None,
                            _getpid=os.getpid):
    if basename is None:
        basename = appname
    folder = devenv.GetAppFolder(appname, makedirs=True)
    return get_timestamped_logfilename(folder, basename, ext, fmt, timestruct,
                                       _getpid)
Пример #3
0
def GetTimestampedFilename2(appname,
                            basename=None,
                            ext='.log',
                            fmt='%Y-%m-%d-%H-%M-%S',
                            timestruct=None,
                            _getpid=os.getpid):
    """Using default keyword arguments
    return filename ``<appname>_<timestamp>_<pid>.log``
    in the app's folder in ccptechart prefs.
    
    :param appname: Specifies log folder by calling
      :py:meth:`devenv.GetAppFolder(appname)`. Also determines the
      log filename if ``basename`` is not specified.
    :param basename: If specified determines the prefix of the log filename,
      e.g. ``<basename>_<timestamp>_<pid>.log>``
    """
    if basename is None:
        basename = appname
    folder = devenv.GetAppFolder(appname, makedirs=True)
    return get_timestamped_logfilename(folder, basename, ext, fmt, timestruct,
                                       _getpid)
Пример #4
0
def ParseOpts():
    o = argparse.ArgumentParser()
    rootdir = devenv.GetAppFolder(iconrendering.APPNAME)
    o.add_argument(
        'srcfolder',
        help='Source folder relative to root directory. Root defaults to %s' %
        rootdir)
    o.add_argument(
        'dstfolder',
        help='Output folder relative to root directory. Root defaults to %s' %
        rootdir)
    o.add_argument('--rootfolder',
                   '-o',
                   default=rootdir,
                   help='Root output directory. Defaults to %s' % rootdir)
    o.add_argument('--dstrootfolder', default='', help='')
    o.add_argument('--timestampout',
                   default=False,
                   action='store_true',
                   help='If present, append a timestamp to the outdir.')
    return o.parse_args()
Пример #5
0
def ParseOpts():
    p = argparse.ArgumentParser(
        description='Package up Icon Rendering output into various formats.')
    outdir = devenv.GetAppFolder(iconrendering.APPNAME)
    p.add_argument(
        '--rootfolder',
        default=outdir,
        type=str,
        help='Source dir for IEC iconrendering output. Defaults to %s' %
        outdir)
    p.add_argument(
        '--searchfolderGood',
        default='',
        type=str,
        help='Subfolder of rootfolder to search for latest known good.')
    p.add_argument(
        '--subfolderCompare',
        default='',
        type=str,
        help=
        'Subfolder of rootfolder that contains the files we want to compare with the known good.'
    )
    return p.parse_args()