Projects

Project classes holding project configuration.

class ProjectConfig(config)[source]
__init__(config)[source]

Initializes the Config object.

Retrieves configuration from “common.hy” file, or populates it with the default values if it doesn’t exist.

property proxy
property use_proxy
property verify
property user_agent
property loglevel
property active_user
class Project(gconfig, project)[source]

Class holding all the project related data.

This class isn’t supposed to be used directly by the user, instead the Raider class should be used, which will deal with the Project class internally.

name

A string with the name of the application.

base_url

A string with the base URL of the application.

config

A Config object with Raider global configuration plus the variables defined in hy configuration files related to the Project.

users

A UserStore object generated from the “_users” variable set in the hy configuration files for the project.

active_user

A User object pointing to the active user inside the “users” object.

__init__(gconfig, project)[source]

Initializes the Project object.

Sets up the environment necessary to test the specified application.

Parameters

project (str) – A string with the name of the application to be initialized. If not supplied, the last used application will be selected

load()[source]

Loads project settings.

Goes through all the “.hy” files in the project directory, evaluates them all, and returns the created locals, making them available to the rest of Raider.

Files are loaded in alphabetical order, and objects created in one of them will be available to the next one, eliminating the need to use imports. This allows the user to split the configuration files however it makes sense, and Raider doesn’t impose any restrictions on those files.

All “.hy” files in the project directory are evaluated, which could be considered unsafe and could cause all kinds of security issues, but Raider assumes the user knows what they’re doing and will not copy/paste hylang code from untrusted sources.

Returns

A dictionary as returned by the locals() function. It contains all of the locally defined objects in the “.hy” configuration files.

write_session_file()[source]

Saves session data.

Saves user related session data in a file for later use. This includes cookies, headers, and other data extracted using Plugins.

Return type

None

load_session_file()[source]

Loads session data.

If session data was saved with write_session_file() this function will load this data into existing User objects.

Return type

None

write_project_file()[source]

Writes the project settings.

For now only the active user is saved, so that the next time the project is used, there’s no need to specify the user manually.

Return type

None

print(spacing=0)[source]
Return type

None

print_hyfile(hyfile, spacing=0)[source]
Return type

None

print_flow(flow, spacing=0)[source]
Return type

None

print_flowgraph(flowgraph, start, test=None, spacing=0)[source]
Return type

None

property hyfiles
class Projects(config, active_project=None)[source]

Class storing Raider projects.

This class inherits from DataStore, and converts the values into Project objects.

__init__(config, active_project=None)[source]

Initializes a Projects object.

Given a list of Project objects, create the Projects DataStore containing them.

Parameters

projects – A list of Project objects to be added to the Projects DataStore.

search_projects(search=None)[source]
Return type

List[str]

search_hyfiles(results, search=None)[source]
Return type

List[str]

search_flows(results, search_flows=None, search_flowgraphs=None)[source]
Return type

List[str]