def _set_binary(self, build):
        """ Sets the list of binaries to test. """
        self._binary = None

        build = os.path.abspath(build)

        if not os.path.exists(build):
            raise errors.NotFoundException('Path cannot be found', build)

        # Check if it's an installer or an already installed build
        # We have to custom checks via application.is_app_folder as long as
        # mozinstall can't check for an installer (bug 795288)
        if application.is_installer(build, self.options.application) or \
                application.is_app_folder(build):
            self._binary = build
            return

        # Otherwise recursively scan the folder and select the first found build
        for root, dirs, files in os.walk(build):
            # Ensure we select the build by alphabetical order
            files.sort()

            for f in files:
                if not f in [".DS_Store"] and \
                        application.is_installer(f, self.options.application):
                    self._binary = os.path.abspath(os.path.join(root, f))
                    return
Exemple #2
0
    def _set_binary(self, build):
        """ Sets the list of binaries to test. """
        self._binary = None

        build = os.path.abspath(build)

        if not os.path.exists(build):
            raise errors.NotFoundException('Path cannot be found', build)

        # Check if it's an installer or an already installed build
        # We have to custom checks via application.is_app_folder as long as
        # mozinstall can't check for an installer (bug 795288)
        if application.is_installer(build, self.options.application) or \
                application.is_app_folder(build):
            self._binary = build
            return

        # Otherwise recursivily scan the folder and select the first found build
        for root, dirs, files in os.walk(build):
            # Ensure we select the build by alphabetical order
            files.sort()

            for f in files:
                if not f in [".DS_Store"] and \
                        application.is_installer(f, self.options.application):
                    self._binary = os.path.abspath(os.path.join(root, f))
                    return
 def complete_exe(self, entry):
     path = os.environ.get('PATH').split(':')
     #remove duplicates and non existant paths
     path.sort()
     last = path[-1]
     for i in range(len(path) - 2, -1, -1):
         if last == path[i]: del path[i]
         else:
             if (not os.access(path[i], os.R_OK)):
                 del path[i]
             else:
                 last = path[i]
     #all files in $PATH
     files = []
     for i in range(len(path)):
         try:
             pathlist = os.listdir(path[i])
         except OSError:
             pathlist = []
         for j in range(len(pathlist)):
             if pathlist[j].find(entry, 0) == 0:
                 files.append(pathlist[j])
     files.sort()
     return files
 def complete_exe(self, entry):
     path = os.environ.get('PATH').split(':')
     #remove duplicates and non existant paths
     path.sort()
     last = path[-1]
     for i in range(len(path)-2, -1, -1):
         if last==path[i]: del path[i]
         else:
             if(not os.access(path[i],os.R_OK)):
                 del path[i]
             else:
                 last=path[i]
     #all files in $PATH
     files = []
     for i in range(len(path)):
         try:
             pathlist = os.listdir(path[i])
         except OSError:
             pathlist = []
         for j in range(len(pathlist)):
             if pathlist[j].find(entry, 0) == 0:
                 files.append(pathlist[j])
     files.sort()
     return files