Exemplo n.º 1
0
def process_distribution(self, *args, **kwargs):
    """Brutally ugly hack to have post_install functionality. oh. my. god."""
    easy_install.real_process_distribution(self, *args, **kwargs)

    import pkg_resources
    try:
        pkg_resources.require("gitserve")
        gitweb_cgi = pkg_resources.resource_filename("gitserve", "gitweb.cgi")
        os.chmod(gitweb_cgi, 0755)
    except:
        print "Chmodding failed. Try 'chmod +x /path/to/gitserve/gitweb.cgi'"
Exemplo n.º 2
0
def process_distribution(self, *args, **kwargs):
    """ overide process_distribution to add permissions"""
    easy_install.real_process_distribution(self, *args, **kwargs)
    import pkg_resources
    external_path = '/pathto/couchapp/_external'
    
    try:
        pkg_resources.require('couchapp')
        external_path = pkg_resources.resource_filename("couchapp", "_external")
        for dir, dirs, files in os.walk(external_path):
            for i, dirname in enumerate(dirs):
                if dirname.startswith('.'): del dirs[i]
            for file_ in files:
                os.chmod(os.path.join(dir, file_), 0755)  
            
    except:
        print >>sys.stderr, "Chmoding failed. Try to 'chmod -R +x %s'" % external_path