Autocomplete

class narrenschiff.autocomplete.ShellAutocomplete[source]

Set autocompletion.

add()[source]

Add narrenschiff autocomplete to shell config.

Returns

Void

Return type

None

add_autocompletion(path)[source]

Add autocompletion to the config file.

Parameters

path (str) – Path to configuration file

Returns

Void

Return type

None

autocompletion_enabled(config)[source]

Check if the file contains the autocompletion tag.

Parameters

config (list of str) – Configuration file

Returns

Confirmation whether file contains autocompletion tag

Return type

bool

autocompletion_script()[source]

Return autocompletion script.

Returns

Autocompletion script

Return type

list of str

get_abs_path(*args)[source]

Join arguments, and return absolute path.

Parameters

args (list of str) – Paths to be joined

Returns

Absolute path

Return type

str

If the first argument is tilde (~) then the method will expand user.

get_config_file()[source]

Get type of the config file.

Returns

Name of the config file

Return type

str

This method returns either .bashrc (which will later be edited for the current user), or activate which symbolises activate script of your virtualenv.

read_file(path)[source]

Read configuration file.

Parameters

path (str) – Path to the file to read

Returns

File as a list

Return type

list of str