Exemple #1
0
 def _get_ini_path(self, profile_name):
     filename = profile_name + '.ini'
     try:
         return path_join_secure(self.proxy_profiles_path, filename)
     except ValueError as e:
         # security check fails
         print(e)
         _raise_proxy_error(self.NO_PROXY_PROFILE_MSG)
Exemple #2
0
 def _get_ini_path(self, profile_name):
     filename = profile_name + '.ini'
     try:
         return path_join_secure(self.proxy_profiles_path, filename)
     except ValueError as e:
         # security check fails
         print(e)
         _raise_proxy_error(self.NO_PROXY_PROFILE_MSG)
Exemple #3
0
    def get_js_profile(self, js_profiles_path):
        js_profile = self.get("js", default=None)
        if not js_profile:
            return js_profile

        if js_profiles_path is None:
            raise BadOption('Javascript profiles are not enabled')

        try:
            profile_dir = path_join_secure(js_profiles_path, js_profile)
        except ValueError as e:
            # security check fails
            print(e)
            raise BadOption('Javascript profile does not exist')

        if not os.path.isdir(profile_dir):
            raise BadOption('Javascript profile does not exist')
        return profile_dir
Exemple #4
0
    def get_js_profile(self, js_profiles_path):
        js_profile = self.get("js", default=None)
        if not js_profile:
            return js_profile

        if js_profiles_path is None:
            self.raise_error('js',
                             'Javascript profiles are not enabled on server')

        try:
            profile_dir = path_join_secure(js_profiles_path, js_profile)
        except ValueError as e:
            # security check fails
            print(e)
            self.raise_error('js', 'Javascript profile does not exist')

        if not os.path.isdir(profile_dir):
            self.raise_error('js', 'Javascript profile does not exist')

        return profile_dir