Skip to main content

Utils used by GetMoney Inc.

Project description

GetMoney Inc. Utils

gmi_exception

Exceptions caused by GMI must be instances of GmiException:

# using plain GmiException
if is_something_bad_happened:
    raise GmiException('something bad happened!')

# using child of GmiException
class MyGmiException(GmiException):
    # your code...
    pass

if is_something_bad_happened_inside_lib:
    raise MyGmiException('something bad happened inside my lib!')

interval

call_repeatedly

stop_func = call_repeatedly(timeout, func, *args) starts calling func(*args) every timeout seconds in different thread. It also returns func that will stop this behaviour.

def bla_bla(last_bla: str):
    print(f"bla bla {last_bla}")

stop_func = call_repeatedly(1., bla_bla, "BLA!")
time.sleep(2.5)
stop_func()

# will print:
# bla bla BLA!
# bla bla BLA!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gmi_utils-0.1.8.tar.gz (2.0 kB view details)

Uploaded Source

File details

Details for the file gmi_utils-0.1.8.tar.gz.

File metadata

  • Download URL: gmi_utils-0.1.8.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for gmi_utils-0.1.8.tar.gz
Algorithm Hash digest
SHA256 2fcd6c16dbd89d0926b60b9035b7df448ecb57e97588fcc4558fe799fde244e7
MD5 e8d5bda0194f5b4bfc6fe6468da0e917
BLAKE2b-256 24d183256e7ef4f01175e3782ae5dc368c71fc765ba94003be8ba6d33effbea5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page