## Decorator to return a default value for a function when offline
Decorate your functions with a default value and set OfflineSandbox.SANDBOX to your Online/Offline status
```
import OfflineSandbox
OfflineSandbox.SANDBOX = False
@OfflineSandbox.offline_sandbox_value('mundo')
def greet():
return 'hola'
print(greet())
OfflineSandbox.SANDBOX = True
print(greet())
```
You can also respond given the availability of a specific URL
```
@OfflineSandbox.offline_sandbox_value('mundo', url='https://im-online.herokuapp.com/')
def greet_with_url():
return 'hola'
print(greet_with_url())
```
Decorate your functions with a default value and set OfflineSandbox.SANDBOX to your Online/Offline status
```
import OfflineSandbox
OfflineSandbox.SANDBOX = False
@OfflineSandbox.offline_sandbox_value('mundo')
def greet():
return 'hola'
print(greet())
OfflineSandbox.SANDBOX = True
print(greet())
```
You can also respond given the availability of a specific URL
```
@OfflineSandbox.offline_sandbox_value('mundo', url='https://im-online.herokuapp.com/')
def greet_with_url():
return 'hola'
print(greet_with_url())
```
Metadata
Release files for offline_sandbox 1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| offline_sandbox-1.tar.gz | 1.6 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| offline_sandbox-1-py3-none-any.whl | Python 3 | none | any | Details |
| offline_sandbox-1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 8.6 kB
Release files / offline_sandbox-1.tar.gz
| Download URL | offline_sandbox-1.tar.gz |
|---|---|
| Size | 1.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c0ab1f456a4e452f5df7f2d43d3a388f0f03d1f13ab31f02323a3d4f9b4e009d
|
|
BLAKE2b-256 checksum How to use checksums |
cb34488fb7819f6a4976f0ff6ca05d6c21dd6588d6a43344786a172518043e5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / offline_sandbox-1-py3-none-any.whl
| Download URL | offline_sandbox-1-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df4ede388b32b3e85ea6b7e68c69ec35742177d86baf01081a1b54e929edc18a
|
|
BLAKE2b-256 checksum How to use checksums |
e0723957adb18e1ac9f4c828de857debf0b710c74e15e663c6afef2145c589f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / offline_sandbox-1-py2.py3-none-any.whl
| Download URL | offline_sandbox-1-py2.py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
c31294a573b5bee7360e14a60812437c3e020cb23d3b97f45a27dd082d36db29
|
|
BLAKE2b-256 checksum How to use checksums |
ec5ac8c463a985886afa23cb198c2a939261b8edbfa9dff4541da194ee36ff3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |