Beispiel #1
0
def walk(arg, dirname, names):
    global numStamped
    vars, debug, descriptions = arg
    for name in names:
        for pat in g_patterns:
            if fnmatch.fnmatch(name, pat):
                # Handle the "_d" thing.
                pathname = os.path.join(dirname, name)
                base, ext = os.path.splitext(name)
                if base[-2:] == "_d":
                    name = base[:-2] + ext
                is_dll = ext.lower() != ".exe"
                if os.path.normcase(name) in descriptions:
                    desc = descriptions[os.path.normcase(name)]
                    try:
                        verstamp.stamp(vars, pathname, desc, is_dll=is_dll)
                        numStamped = numStamped + 1
                    except win32api.error as exc:
                        print(
                            "Could not stamp",
                            pathname,
                            "Error",
                            exc.winerror,
                            "-",
                            exc.strerror,
                        )
                else:
                    print("WARNING: description not provided for:", name)
Beispiel #2
0
def walk(arg, dirname, names):
  global numStamped
  vars, debug, descriptions = arg
  for name in names:
    for pat in g_patterns:
      if fnmatch.fnmatch(name, pat):
        # Handle the "_d" thing.
        pathname = os.path.join(dirname, name)
        base, ext = os.path.splitext(name)
        if base[-2:]=='_d':
          name = base[:-2] + ext
        is_dll = ext.lower() != ".exe"
        if os.path.normcase(name) in descriptions:
          desc = descriptions[os.path.normcase(name)]
          try:
            verstamp.stamp(vars, pathname, desc, is_dll=is_dll)
            numStamped = numStamped + 1
          except win32api.error as exc:
            print("Could not stamp", pathname, "Error", exc.winerror, "-", exc.strerror)
        else:
          print('WARNING: description not provided for:', name)
Beispiel #3
0
def walk(arg, dirname, names):
    global numStamped
    vars, debug, descriptions = arg
    for name in names:
        for pat in g_patterns:
            if fnmatch.fnmatch(name, pat):
                # Handle the "_d" thing.
                pathname = os.path.join(dirname, name)
                base, ext = os.path.splitext(name)
                if base[-2:] == '_d':
                    name = base[:-2] + ext
                is_dll = ext.lower() != ".exe"
                if descriptions.has_key(os.path.normcase(name)):
                    desc = descriptions[os.path.normcase(name)]
                    try:
                        verstamp.stamp(vars, pathname, desc, is_dll=is_dll)
                        numStamped = numStamped + 1
                    except win32api.error, (hr, func, desc):
                        print "Could not stamp", pathname, "Error", hr, "-", desc
                else:
                    print 'WARNING: description not provided for:', name