text
stringlengths 1
93.6k
|
|---|
Raised for cases where a web request doesn't return what we wanted it to.
|
"""
|
def __init__(self, *args: object):
|
if args:
|
super().__init__(*args)
|
else:
|
super().__init__("Unknown error during request")
|
class RequestInvalid(RequestException):
|
"""
|
Raised when a request becomes no longer valid inside its retry loop.
|
Intended for internal use only.
|
"""
|
def __init__(self):
|
super().__init__("Request became invalid during its retry loop")
|
class WebsocketClosed(RequestException):
|
"""
|
Raised when the websocket connection has been closed.
|
Attributes:
|
-----------
|
received: bool
|
`True` if the closing was caused by our side receiving a close frame, `False` otherwise.
|
"""
|
def __init__(self, *args: object, received: bool = False):
|
if args:
|
super().__init__(*args)
|
else:
|
super().__init__("Websocket has been closed")
|
self.received: bool = received
|
class LoginException(RequestException):
|
"""
|
Raised when an exception occurs during login phase.
|
"""
|
def __init__(self, *args: object):
|
if args:
|
super().__init__(*args)
|
else:
|
super().__init__("Unknown error during login")
|
class CaptchaRequired(LoginException):
|
"""
|
The most dreaded thing about automated scripts...
|
"""
|
def __init__(self):
|
super().__init__("Captcha is required")
|
class GQLException(RequestException):
|
"""
|
Raised when a GQL request returns an error response.
|
"""
|
def __init__(self, message: str):
|
super().__init__(message)
|
# <FILESEP>
|
#name: lashelper.py
|
#created: jan 2020
|
#by: paul.kennedy@guardiangeomatics.com
|
#description: python module to spawn processes in relation to lastools
|
#copyright Guardian Geomatics Pty Ltd
|
# This software is explicitly prohibited by use of any non-guardian employee or subcontractor.
|
#
|
##################
|
# #DONE
|
##################
|
import os
|
import shlex
|
import subprocess
|
import uuid
|
import sys
|
import time
|
import logging
|
import ctypes
|
import multiprocessing
|
import tempfile
|
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'shared'))
|
import geodetic
|
import fileutils
|
###############################################################################
|
def runner(cmd, verbose=False):
|
'''process runner method. pass the command to run and True if you want to real time verbose output of errors'''
|
cmdname = cmd.split(" ")
|
# log('Processing command %s' % (cmdname))
|
args = shlex.split(cmd)
|
stdout = []
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.