Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 9th, 2013  |  syntax: None  |  size: 0.97 KB  |  views: 26  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def findfile (sfilename, dir):
  2.     import shutil
  3.     import fnmatch
  4.     import os
  5.     matches = []
  6.     for root, dirnames, filenames in os.walk(dir):
  7.         for filename in fnmatch.filter(filenames, sfilename):
  8.             matches.append(os.path.join(root, filename))
  9.             return matches
  10.  
  11. addtask do_signing after do_deploy
  12.  
  13. python do_signing() {
  14.     matches = []
  15.     signfiles = []
  16.     deploydir = d.getVar('DEPLOY_DIR_IMAGE', True)
  17.     signfiles = d.getVar('SRC_SIGNING', True)
  18.  
  19.  
  20.     if not signfiles:
  21.         return
  22.     bb.warn ("do_signing ", deploydir)
  23.     for item in d.getVar('SRC_SIGNING', True).split():
  24.         matches = findfile(item,deploydir)
  25.         if not matches:
  26.             bb.warn ("file not found", item)
  27.         elif len(matches) == 1:
  28.             bb.warn ("item found ", item)
  29.             """
  30.             Add the line of code to sign the file
  31.             """
  32.         else:
  33.             bb.warn ("more than one occurence found") }
clone this paste RAW Paste Data