コード例 #1
0
ファイル: get_drivers.py プロジェクト: kom3/Keycloak_Django
 def _get_drivers(self):
     """This function gets all the drivers in the ProductDrivers directory"""
     all_drivers = {}
     all_driver_files = get_direct_sub_files(
         self.pd_dir, abs_path=True, extension=compile_regex("^\.py$"))
     for file_path in all_driver_files:
         driver_name = get_dir_from_path(file_path).split(".")[0]
         if driver_name != "__init__":
             all_drivers[driver_name] = {"path": file_path, "actions": None}
     return all_drivers
コード例 #2
0
 def set_apps(self, data):
     """ call this to build Apps array and make app objects """
     self.get_config_paths(data)
     for url in self.paths:
         json_data = read_json_data(url)
         if json_data is not None:
             app_path = get_parent_directory(url)
             app = App(json_data, app_path, data["base_directory"])
             js_urls = get_paths_of_subfiles(
                 join_path(app_path, app.static_file_dir, "js"),
                 extension=compile_regex("^\.js$"))
             for i in range(0, len(js_urls)):
                 js_urls[i] = get_relative_path(js_urls[i], app_path)
             app.data["js_urls"] = js_urls
             self.apps.append(app)
     return self.apps
コード例 #3
0
ファイル: get_drivers.py プロジェクト: kom3/Keycloak_Django
 def _get_action_files(actions_directory):
     """ This function gets the path to the action files """
     return get_paths_of_subfiles(actions_directory,
                                  extension=compile_regex("^\.py$"))