nptr_cli package#
Submodules#
nptr_cli.nptr module#
- class nptr_cli.nptr.CLI[source]#
Bases:
object
- static delete(args, args_help)[source]#
CLI wrapper for the delete method.
- Parameters:
args (argparse.Namespace) – the args parsed by argparse
args_help – the print_help function from the argparse parser
- static parse_config(file: str = PosixPath('/home/runner/.config/0x0/config.toml')) dict [source]#
Parses the config file to override defaults.
- static upload(args: Namespace, args_help)[source]#
CLI wrapper for the upload method.
- Parameters:
args (argparse.Namespace) – the args parsed by argparse
args_help – the print_help function from the argparse parser
- class nptr_cli.nptr.NullPointer(instance_url: str = 'https://0x0.st', username: Optional[str] = None, password: Optional[str] = None, log_dir: Optional[Path] = None)[source]#
Bases:
object
The NullPointer class to abstract away 0x0 API.
- upload(file: bytes, filename: str = 'file', secret: bool = True)[source]#
Upload a file to a 0x0 instance.
- Parameters:
- Raises:
HTTPError –
- Returns:
url is the returned content, which should be the url. expires is the X-Expires header which returns the expiration time of the file submitted or no-expires, when the header did not exist token is the X-Token header with this token you are able to delete the file later on or no-token when the header did not exist which usually means that a file with the same content was already uploaded
- Return type: