Module update_allowed_scripts
[hide private]
[frames] | no frames]

Source Code for Module update_allowed_scripts

 1  #!/usr/bin/env python 
 2  """ 
 3  This script creates hash codes for scripts in the autload folder. 
 4  Normally permitdlg warns about imports and private attribute access. 
 5  The idea is to ship Scribus with "signed" scripts which can be safely 
 6  used although they might use unsafe statements.  
 7  """ 
 8   
 9  import sys 
10  import os 
11  import pprint 
12  from scripterng_runtime import hash_source 
13   
14   
15 -def main(files):
16 # XXX add to build process somehow? 17 allowed = [] 18 for name in files: 19 if not name.endswith(("~", "#", ".pyc", ".pyo")): 20 fn = os.path.join("autoload", name) 21 if not os.path.isdir(fn): 22 allowed.append(hash_source(fn)) 23 print "allowed_scripts = ", 24 pprint.pprint(allowed)
25 26 27 if __name__ == "__main__": 28 main(sys.argv[1:]) 29