v1.2.6 release

def WebRequestParseBodyBytes(inRequest)
def WebRequestParseBodyStr(inRequest)
def WebRequestParseBodyJSON(inRequest)
def WebRequestParseFile(inRequest)
dev-linux v1.2.6
Ivan Maslov 3 years ago
parent 18b0d2d1fd
commit 2c1adc6af3

@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: pyOpenRPA
Version: 1.2.5
Version: 1.2.6
Summary: First open source RPA platform for business
Home-page: https://gitlab.com/UnicodeLabs/OpenRPA
Author: Ivan Maslov

@ -1,9 +1,9 @@
pyOpenRPA-1.2.5.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pyOpenRPA-1.2.5.dist-info/METADATA,sha256=IeBQ9YskhMg5mmzeY-DBQVnCbKUI4pgnl8E9XLlGrQs,3612
pyOpenRPA-1.2.5.dist-info/RECORD,,
pyOpenRPA-1.2.5.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pyOpenRPA-1.2.5.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97
pyOpenRPA-1.2.5.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10
pyOpenRPA-1.2.6.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pyOpenRPA-1.2.6.dist-info/METADATA,sha256=pU-EpQuvMPYjhD1o2BYjfpOfsruNrxm9s7mfWX9mF1M,3612
pyOpenRPA-1.2.6.dist-info/RECORD,,
pyOpenRPA-1.2.6.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pyOpenRPA-1.2.6.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97
pyOpenRPA-1.2.6.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10
pyOpenRPA/.idea/inspectionProfiles/profiles_settings.xml,sha256=YXLFmX7rPNGcnKK1uX1uKYPN0fpgskYNe7t0BV7cqkY,174
pyOpenRPA/.idea/misc.xml,sha256=V-fQnOz-bYEZULgfbFgm-8mURphZrKfXMSd0wKjeEyA,188
pyOpenRPA/.idea/modules.xml,sha256=Q__U1JIA2cjxbLRXAv-SfYY00fZA0TNlpkkbY4s3ncg,277
@ -72,7 +72,7 @@ pyOpenRPA/Orchestrator/Web/Index.js,sha256=Blo3LHe_a3zrW7MqYo4BSIwoOx7nlO7Ko9LWx
pyOpenRPA/Orchestrator/Web/Index.xhtml,sha256=a4N_reLA6_Zb2KXiL73a7cWtJwO0W0Dr5lZ-RpUwuI0,16428
pyOpenRPA/Orchestrator/Web/__pycache__/Basic.cpython-37.pyc,,
pyOpenRPA/Orchestrator/Web/favicon.ico,sha256=6S8XwSQ_3FXPpaX6zYkf8uUewVXO9bHnrrDHEoWrEgw,112922
pyOpenRPA/Orchestrator/__Orchestrator__.py,sha256=2WbaatF0yN1Sx3P1Zru3clMbUTq4N-ErjMmsi0V7TKE,117659
pyOpenRPA/Orchestrator/__Orchestrator__.py,sha256=n-PrWqEDql1POF4bM-r9cTun9WZUqzIYRjxDEmV7xAM,119846
pyOpenRPA/Orchestrator/__init__.py,sha256=f1RFDzOkL3IVorCtqogjGdXYPtHH-P-y-5CqT7PGy7A,183
pyOpenRPA/Orchestrator/__main__.py,sha256=czJrc7_57WiO3EPIYfPeF_LG3pZsQVmuAYgbl_YXcVU,273
pyOpenRPA/Orchestrator/__pycache__/BackwardCompatibility.cpython-37.pyc,,
@ -341,6 +341,6 @@ pyOpenRPA/Tools/Terminator.py,sha256=VcjX3gFXiCGu3MMCidhrTNsmC9wsAqfjRJdTSU9fLnU
pyOpenRPA/Tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pyOpenRPA/Tools/__pycache__/Terminator.cpython-37.pyc,,
pyOpenRPA/Tools/__pycache__/__init__.cpython-37.pyc,,
pyOpenRPA/__init__.py,sha256=7jBgAILYoa342lTEQGpNGus8Zpiei0bAZkw1sVLtsGI,174
pyOpenRPA/__init__.py,sha256=fI-2Npv3ZqIEhm1omXoocfYZw7PY1Ccf_pHXi_bvI0w,174
pyOpenRPA/__pycache__/__init__.cpython-37.pyc,,
pyOpenRPA/test.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0

@ -767,6 +767,64 @@ def WebAuditMessageCreate(inRequest, inOperationCodeStr="-", inMessageStr="-"):
lResultStr = inMessageStr
return lResultStr
def WebRequestParseBodyBytes(inRequest):
"""
Extract the body in bytes from the request
:param inRequest: inRequest from the server
:return: Bytes or None
"""
lBodyBytes=None
if inRequest.headers.get('Content-Length') is not None:
lInputByteArrayLength = int(inRequest.headers.get('Content-Length'))
lBodyBytes = inRequest.rfile.read(lInputByteArrayLength)
return lBodyBytes
def WebRequestParseBodyStr(inRequest):
"""
Extract the body in str from the request
:param inRequest: inRequest from the server
:return: str or None
"""
return WebRequestParseBodyBytes(inRequest=inRequest).decode('utf-8')
def WebRequestParseBodyJSON(inRequest):
"""
Extract the body in dict/list from the request
:param inRequest:
:return: dict or list
"""
return json.loads(WebRequestParseBodyStr(inRequest=inRequest))
def WebRequestParseFile(inRequest):
"""
Parse the request - extract the file (name, body in bytes)
:param inRequest:
:return: (FileNameStr, FileBodyBytes) or (None, None)
"""
lResultTurple=(None,None)
if inRequest.headers.get('Content-Length') is not None:
lInputByteArray = WebRequestParseBodyBytes(inRequest=inRequest)
#print(f"BODY:ftInputByteArrayl")
# Extract bytes data
lBoundaryStr = str(inRequest.headers.get('Content-Type'))
lBoundaryStr = lBoundaryStr[lBoundaryStr.index("boundary=")+9:] # get the boundary key #print(LBoundoryStr)
lSplit = lInputByteArray.split('\r\n\r\n')
lDelimiterRNRNIndex = lInputByteArray.index(b'\r\n\r\n') #print(LSplit) # Get file name
lSplit0 = lInputByteArray[:lDelimiterRNRNIndex].split(b'\r\n')[1]
lFileNameBytes = lSplit0[lSplit0.index(b'filename="')+10:-1]
lFileNameStr = lFileNameBytes.decode("utf-8")
# File data bytes
lFileDataBytes = lInputByteArray[lDelimiterRNRNIndex+4:]
lFileDataBytes = lFileDataBytes[:lFileDataBytes.index(b"\r\n--"+lBoundaryStr.encode("utf-8"))]
lResultTurple = (lFileNameStr, lFileDataBytes)
return lResultTurple
def WebUserInfoGet(inRequest):
"""
Return User info about request

@ -3,7 +3,7 @@ r"""
The OpenRPA package (from UnicodeLabs)
"""
__version__ = 'v1.2.5'
__version__ = 'v1.2.6'
__all__ = []
__author__ = 'Ivan Maslov <ivan.maslov@unicodelabs.ru>'
#from .Core import Robot

@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: pyOpenRPA
Version: 1.2.5
Version: 1.2.6
Summary: First open source RPA platform for business
Home-page: https://gitlab.com/UnicodeLabs/OpenRPA
Author: Ivan Maslov

@ -1,9 +1,9 @@
pyOpenRPA-1.2.5.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pyOpenRPA-1.2.5.dist-info/METADATA,sha256=IeBQ9YskhMg5mmzeY-DBQVnCbKUI4pgnl8E9XLlGrQs,3612
pyOpenRPA-1.2.5.dist-info/RECORD,,
pyOpenRPA-1.2.5.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pyOpenRPA-1.2.5.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97
pyOpenRPA-1.2.5.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10
pyOpenRPA-1.2.6.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pyOpenRPA-1.2.6.dist-info/METADATA,sha256=pU-EpQuvMPYjhD1o2BYjfpOfsruNrxm9s7mfWX9mF1M,3612
pyOpenRPA-1.2.6.dist-info/RECORD,,
pyOpenRPA-1.2.6.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pyOpenRPA-1.2.6.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97
pyOpenRPA-1.2.6.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10
pyOpenRPA/.idea/inspectionProfiles/profiles_settings.xml,sha256=YXLFmX7rPNGcnKK1uX1uKYPN0fpgskYNe7t0BV7cqkY,174
pyOpenRPA/.idea/misc.xml,sha256=V-fQnOz-bYEZULgfbFgm-8mURphZrKfXMSd0wKjeEyA,188
pyOpenRPA/.idea/modules.xml,sha256=Q__U1JIA2cjxbLRXAv-SfYY00fZA0TNlpkkbY4s3ncg,277
@ -72,7 +72,7 @@ pyOpenRPA/Orchestrator/Web/Index.js,sha256=Blo3LHe_a3zrW7MqYo4BSIwoOx7nlO7Ko9LWx
pyOpenRPA/Orchestrator/Web/Index.xhtml,sha256=a4N_reLA6_Zb2KXiL73a7cWtJwO0W0Dr5lZ-RpUwuI0,16428
pyOpenRPA/Orchestrator/Web/__pycache__/Basic.cpython-37.pyc,,
pyOpenRPA/Orchestrator/Web/favicon.ico,sha256=6S8XwSQ_3FXPpaX6zYkf8uUewVXO9bHnrrDHEoWrEgw,112922
pyOpenRPA/Orchestrator/__Orchestrator__.py,sha256=2WbaatF0yN1Sx3P1Zru3clMbUTq4N-ErjMmsi0V7TKE,117659
pyOpenRPA/Orchestrator/__Orchestrator__.py,sha256=n-PrWqEDql1POF4bM-r9cTun9WZUqzIYRjxDEmV7xAM,119846
pyOpenRPA/Orchestrator/__init__.py,sha256=f1RFDzOkL3IVorCtqogjGdXYPtHH-P-y-5CqT7PGy7A,183
pyOpenRPA/Orchestrator/__main__.py,sha256=czJrc7_57WiO3EPIYfPeF_LG3pZsQVmuAYgbl_YXcVU,273
pyOpenRPA/Orchestrator/__pycache__/BackwardCompatibility.cpython-37.pyc,,
@ -341,6 +341,6 @@ pyOpenRPA/Tools/Terminator.py,sha256=VcjX3gFXiCGu3MMCidhrTNsmC9wsAqfjRJdTSU9fLnU
pyOpenRPA/Tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pyOpenRPA/Tools/__pycache__/Terminator.cpython-37.pyc,,
pyOpenRPA/Tools/__pycache__/__init__.cpython-37.pyc,,
pyOpenRPA/__init__.py,sha256=7jBgAILYoa342lTEQGpNGus8Zpiei0bAZkw1sVLtsGI,174
pyOpenRPA/__init__.py,sha256=fI-2Npv3ZqIEhm1omXoocfYZw7PY1Ccf_pHXi_bvI0w,174
pyOpenRPA/__pycache__/__init__.cpython-37.pyc,,
pyOpenRPA/test.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0

@ -767,6 +767,64 @@ def WebAuditMessageCreate(inRequest, inOperationCodeStr="-", inMessageStr="-"):
lResultStr = inMessageStr
return lResultStr
def WebRequestParseBodyBytes(inRequest):
"""
Extract the body in bytes from the request
:param inRequest: inRequest from the server
:return: Bytes or None
"""
lBodyBytes=None
if inRequest.headers.get('Content-Length') is not None:
lInputByteArrayLength = int(inRequest.headers.get('Content-Length'))
lBodyBytes = inRequest.rfile.read(lInputByteArrayLength)
return lBodyBytes
def WebRequestParseBodyStr(inRequest):
"""
Extract the body in str from the request
:param inRequest: inRequest from the server
:return: str or None
"""
return WebRequestParseBodyBytes(inRequest=inRequest).decode('utf-8')
def WebRequestParseBodyJSON(inRequest):
"""
Extract the body in dict/list from the request
:param inRequest:
:return: dict or list
"""
return json.loads(WebRequestParseBodyStr(inRequest=inRequest))
def WebRequestParseFile(inRequest):
"""
Parse the request - extract the file (name, body in bytes)
:param inRequest:
:return: (FileNameStr, FileBodyBytes) or (None, None)
"""
lResultTurple=(None,None)
if inRequest.headers.get('Content-Length') is not None:
lInputByteArray = WebRequestParseBodyBytes(inRequest=inRequest)
#print(f"BODY:ftInputByteArrayl")
# Extract bytes data
lBoundaryStr = str(inRequest.headers.get('Content-Type'))
lBoundaryStr = lBoundaryStr[lBoundaryStr.index("boundary=")+9:] # get the boundary key #print(LBoundoryStr)
lSplit = lInputByteArray.split('\r\n\r\n')
lDelimiterRNRNIndex = lInputByteArray.index(b'\r\n\r\n') #print(LSplit) # Get file name
lSplit0 = lInputByteArray[:lDelimiterRNRNIndex].split(b'\r\n')[1]
lFileNameBytes = lSplit0[lSplit0.index(b'filename="')+10:-1]
lFileNameStr = lFileNameBytes.decode("utf-8")
# File data bytes
lFileDataBytes = lInputByteArray[lDelimiterRNRNIndex+4:]
lFileDataBytes = lFileDataBytes[:lFileDataBytes.index(b"\r\n--"+lBoundaryStr.encode("utf-8"))]
lResultTurple = (lFileNameStr, lFileDataBytes)
return lResultTurple
def WebUserInfoGet(inRequest):
"""
Return User info about request

@ -3,7 +3,7 @@ r"""
The OpenRPA package (from UnicodeLabs)
"""
__version__ = 'v1.2.5'
__version__ = 'v1.2.6'
__all__ = []
__author__ = 'Ivan Maslov <ivan.maslov@unicodelabs.ru>'
#from .Core import Robot

@ -767,6 +767,64 @@ def WebAuditMessageCreate(inRequest, inOperationCodeStr="-", inMessageStr="-"):
lResultStr = inMessageStr
return lResultStr
def WebRequestParseBodyBytes(inRequest):
"""
Extract the body in bytes from the request
:param inRequest: inRequest from the server
:return: Bytes or None
"""
lBodyBytes=None
if inRequest.headers.get('Content-Length') is not None:
lInputByteArrayLength = int(inRequest.headers.get('Content-Length'))
lBodyBytes = inRequest.rfile.read(lInputByteArrayLength)
return lBodyBytes
def WebRequestParseBodyStr(inRequest):
"""
Extract the body in str from the request
:param inRequest: inRequest from the server
:return: str or None
"""
return WebRequestParseBodyBytes(inRequest=inRequest).decode('utf-8')
def WebRequestParseBodyJSON(inRequest):
"""
Extract the body in dict/list from the request
:param inRequest:
:return: dict or list
"""
return json.loads(WebRequestParseBodyStr(inRequest=inRequest))
def WebRequestParseFile(inRequest):
"""
Parse the request - extract the file (name, body in bytes)
:param inRequest:
:return: (FileNameStr, FileBodyBytes) or (None, None)
"""
lResultTurple=(None,None)
if inRequest.headers.get('Content-Length') is not None:
lInputByteArray = WebRequestParseBodyBytes(inRequest=inRequest)
#print(f"BODY:ftInputByteArrayl")
# Extract bytes data
lBoundaryStr = str(inRequest.headers.get('Content-Type'))
lBoundaryStr = lBoundaryStr[lBoundaryStr.index("boundary=")+9:] # get the boundary key #print(LBoundoryStr)
lSplit = lInputByteArray.split('\r\n\r\n')
lDelimiterRNRNIndex = lInputByteArray.index(b'\r\n\r\n') #print(LSplit) # Get file name
lSplit0 = lInputByteArray[:lDelimiterRNRNIndex].split(b'\r\n')[1]
lFileNameBytes = lSplit0[lSplit0.index(b'filename="')+10:-1]
lFileNameStr = lFileNameBytes.decode("utf-8")
# File data bytes
lFileDataBytes = lInputByteArray[lDelimiterRNRNIndex+4:]
lFileDataBytes = lFileDataBytes[:lFileDataBytes.index(b"\r\n--"+lBoundaryStr.encode("utf-8"))]
lResultTurple = (lFileNameStr, lFileDataBytes)
return lResultTurple
def WebUserInfoGet(inRequest):
"""
Return User info about request

@ -3,7 +3,7 @@ r"""
The OpenRPA package (from UnicodeLabs)
"""
__version__ = 'v1.2.5'
__version__ = 'v1.2.6'
__all__ = []
__author__ = 'Ivan Maslov <ivan.maslov@unicodelabs.ru>'
#from .Core import Robot

@ -429,6 +429,18 @@
<tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebListenCreate" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebListenCreate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebListenCreate</span></code></a>(inGSettings[, …])</p></td>
<td><p>Create listen interface for the web server</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyBytes" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyBytes"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebRequestParseBodyBytes</span></code></a>(inRequest)</p></td>
<td><p>Extract the body in bytes from the request</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyJSON" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyJSON"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebRequestParseBodyJSON</span></code></a>(inRequest)</p></td>
<td><p>Extract the body in dict/list from the request</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyStr" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyStr"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebRequestParseBodyStr</span></code></a>(inRequest)</p></td>
<td><p>Extract the body in str from the request</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseFile" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseFile"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebRequestParseFile</span></code></a>(inRequest)</p></td>
<td><p>Parse the request - extract the file (name, body in bytes)</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectDef" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectDef"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebURLConnectDef</span></code></a>(inGSettings, inMethodStr, …)</p></td>
<td><p>Connect URL to DEF</p></td>
</tr>
@ -1900,6 +1912,62 @@ Var 2 (Backward compatibility): inGSettings, inRDPSessionKeyStr, inHostStr, inPo
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyBytes">
<code class="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><code class="sig-name descname">WebRequestParseBodyBytes</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">inRequest</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#WebRequestParseBodyBytes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyBytes" title="Permalink to this definition"></a></dt>
<dd><p>Extract the body in bytes from the request</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>inRequest</strong> inRequest from the server</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Bytes or None</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyJSON">
<code class="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><code class="sig-name descname">WebRequestParseBodyJSON</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">inRequest</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#WebRequestParseBodyJSON"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyJSON" title="Permalink to this definition"></a></dt>
<dd><p>Extract the body in dict/list from the request</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>inRequest</strong> </p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>dict or list</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyStr">
<code class="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><code class="sig-name descname">WebRequestParseBodyStr</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">inRequest</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#WebRequestParseBodyStr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyStr" title="Permalink to this definition"></a></dt>
<dd><p>Extract the body in str from the request</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>inRequest</strong> inRequest from the server</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>str or None</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseFile">
<code class="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><code class="sig-name descname">WebRequestParseFile</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">inRequest</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#WebRequestParseFile"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseFile" title="Permalink to this definition"></a></dt>
<dd><p>Parse the request - extract the file (name, body in bytes)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>inRequest</strong> </p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>(FileNameStr, FileBodyBytes) or (None, None)</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectDef">
<code class="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><code class="sig-name descname">WebURLConnectDef</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">inGSettings</span></em>, <em class="sig-param"><span class="n">inMethodStr</span></em>, <em class="sig-param"><span class="n">inURLStr</span></em>, <em class="sig-param"><span class="n">inMatchTypeStr</span></em>, <em class="sig-param"><span class="n">inDef</span></em>, <em class="sig-param"><span class="n">inContentTypeStr</span><span class="o">=</span><span class="default_value">'application/octet-stream'</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#WebURLConnectDef"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectDef" title="Permalink to this definition"></a></dt>

@ -948,6 +948,64 @@
<span class="n">lResultStr</span> <span class="o">=</span> <span class="n">inMessageStr</span>
<span class="k">return</span> <span class="n">lResultStr</span></div>
<div class="viewcode-block" id="WebRequestParseBodyBytes"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyBytes">[docs]</a><span class="k">def</span> <span class="nf">WebRequestParseBodyBytes</span><span class="p">(</span><span class="n">inRequest</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Extract the body in bytes from the request</span>
<span class="sd"> :param inRequest: inRequest from the server</span>
<span class="sd"> :return: Bytes or None</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">lBodyBytes</span><span class="o">=</span><span class="kc">None</span>
<span class="k">if</span> <span class="n">inRequest</span><span class="o">.</span><span class="n">headers</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;Content-Length&#39;</span><span class="p">)</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">lInputByteArrayLength</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">inRequest</span><span class="o">.</span><span class="n">headers</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;Content-Length&#39;</span><span class="p">))</span>
<span class="n">lBodyBytes</span> <span class="o">=</span> <span class="n">inRequest</span><span class="o">.</span><span class="n">rfile</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="n">lInputByteArrayLength</span><span class="p">)</span>
<span class="k">return</span> <span class="n">lBodyBytes</span></div>
<div class="viewcode-block" id="WebRequestParseBodyStr"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyStr">[docs]</a><span class="k">def</span> <span class="nf">WebRequestParseBodyStr</span><span class="p">(</span><span class="n">inRequest</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Extract the body in str from the request</span>
<span class="sd"> :param inRequest: inRequest from the server</span>
<span class="sd"> :return: str or None</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">WebRequestParseBodyBytes</span><span class="p">(</span><span class="n">inRequest</span><span class="o">=</span><span class="n">inRequest</span><span class="p">)</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s1">&#39;utf-8&#39;</span><span class="p">)</span></div>
<div class="viewcode-block" id="WebRequestParseBodyJSON"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyJSON">[docs]</a><span class="k">def</span> <span class="nf">WebRequestParseBodyJSON</span><span class="p">(</span><span class="n">inRequest</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Extract the body in dict/list from the request</span>
<span class="sd"> :param inRequest:</span>
<span class="sd"> :return: dict or list</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="n">WebRequestParseBodyStr</span><span class="p">(</span><span class="n">inRequest</span><span class="o">=</span><span class="n">inRequest</span><span class="p">))</span></div>
<div class="viewcode-block" id="WebRequestParseFile"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseFile">[docs]</a><span class="k">def</span> <span class="nf">WebRequestParseFile</span><span class="p">(</span><span class="n">inRequest</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Parse the request - extract the file (name, body in bytes)</span>
<span class="sd"> :param inRequest:</span>
<span class="sd"> :return: (FileNameStr, FileBodyBytes) or (None, None)</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">lResultTurple</span><span class="o">=</span><span class="p">(</span><span class="kc">None</span><span class="p">,</span><span class="kc">None</span><span class="p">)</span>
<span class="k">if</span> <span class="n">inRequest</span><span class="o">.</span><span class="n">headers</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;Content-Length&#39;</span><span class="p">)</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">lInputByteArray</span> <span class="o">=</span> <span class="n">WebRequestParseBodyBytes</span><span class="p">(</span><span class="n">inRequest</span><span class="o">=</span><span class="n">inRequest</span><span class="p">)</span>
<span class="c1">#print(f&quot;BODY:ftInputByteArrayl&quot;)</span>
<span class="c1"># Extract bytes data</span>
<span class="n">lBoundaryStr</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">inRequest</span><span class="o">.</span><span class="n">headers</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;Content-Type&#39;</span><span class="p">))</span>
<span class="n">lBoundaryStr</span> <span class="o">=</span> <span class="n">lBoundaryStr</span><span class="p">[</span><span class="n">lBoundaryStr</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="s2">&quot;boundary=&quot;</span><span class="p">)</span><span class="o">+</span><span class="mi">9</span><span class="p">:]</span> <span class="c1"># get the boundary key #print(LBoundoryStr)</span>
<span class="n">lSplit</span> <span class="o">=</span> <span class="n">lInputByteArray</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;</span><span class="se">\r\n\r\n</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="n">lDelimiterRNRNIndex</span> <span class="o">=</span> <span class="n">lInputByteArray</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="sa">b</span><span class="s1">&#39;</span><span class="se">\r\n\r\n</span><span class="s1">&#39;</span><span class="p">)</span> <span class="c1">#print(LSplit) # Get file name</span>
<span class="n">lSplit0</span> <span class="o">=</span> <span class="n">lInputByteArray</span><span class="p">[:</span><span class="n">lDelimiterRNRNIndex</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="sa">b</span><span class="s1">&#39;</span><span class="se">\r\n</span><span class="s1">&#39;</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span>
<span class="n">lFileNameBytes</span> <span class="o">=</span> <span class="n">lSplit0</span><span class="p">[</span><span class="n">lSplit0</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="sa">b</span><span class="s1">&#39;filename=&quot;&#39;</span><span class="p">)</span><span class="o">+</span><span class="mi">10</span><span class="p">:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
<span class="n">lFileNameStr</span> <span class="o">=</span> <span class="n">lFileNameBytes</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s2">&quot;utf-8&quot;</span><span class="p">)</span>
<span class="c1"># File data bytes</span>
<span class="n">lFileDataBytes</span> <span class="o">=</span> <span class="n">lInputByteArray</span><span class="p">[</span><span class="n">lDelimiterRNRNIndex</span><span class="o">+</span><span class="mi">4</span><span class="p">:]</span>
<span class="n">lFileDataBytes</span> <span class="o">=</span> <span class="n">lFileDataBytes</span><span class="p">[:</span><span class="n">lFileDataBytes</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="sa">b</span><span class="s2">&quot;</span><span class="se">\r\n</span><span class="s2">--&quot;</span><span class="o">+</span><span class="n">lBoundaryStr</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s2">&quot;utf-8&quot;</span><span class="p">))]</span>
<span class="n">lResultTurple</span> <span class="o">=</span> <span class="p">(</span><span class="n">lFileNameStr</span><span class="p">,</span> <span class="n">lFileDataBytes</span><span class="p">)</span>
<span class="k">return</span> <span class="n">lResultTurple</span></div>
<div class="viewcode-block" id="WebUserInfoGet"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.WebUserInfoGet">[docs]</a><span class="k">def</span> <span class="nf">WebUserInfoGet</span><span class="p">(</span><span class="n">inRequest</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return User info about request</span>

@ -484,10 +484,18 @@
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.WebListenCreate">WebListenCreate() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectDef">WebURLConnectDef() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyBytes">WebRequestParseBodyBytes() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyJSON">WebRequestParseBodyJSON() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyStr">WebRequestParseBodyStr() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseFile">WebRequestParseFile() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectDef">WebURLConnectDef() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectFile">WebURLConnectFile() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectFolder">WebURLConnectFolder() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>

Binary file not shown.

File diff suppressed because one or more lines are too long

@ -339,6 +339,26 @@ Work with activity scheduling.
| Create listen interface for the web server
|
| `WebRequestParseBodyBytes`(inRequest)
| Extract the body in bytes from the request
|
| `WebRequestParseBodyJSON`(inRequest)
| Extract the body in dict/list from the request
|
| `WebRequestParseBodyStr`(inRequest)
| Extract the body in str from the request
|
| `WebRequestParseFile`(inRequest)
| Parse the request - extract the file (name, body in bytes)
|
| `WebURLConnectDef`(inGSettings, inMethodStr, …)
| Connect URL to DEF
@ -2174,6 +2194,70 @@ Create listen interface for the web server
### pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyBytes(inRequest)
Extract the body in bytes from the request
* **Parameters**
**inRequest** inRequest from the server
* **Returns**
Bytes or None
### pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyJSON(inRequest)
Extract the body in dict/list from the request
* **Parameters**
**inRequest**
* **Returns**
dict or list
### pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyStr(inRequest)
Extract the body in str from the request
* **Parameters**
**inRequest** inRequest from the server
* **Returns**
str or None
### pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseFile(inRequest)
Parse the request - extract the file (name, body in bytes)
* **Parameters**
**inRequest**
* **Returns**
(FileNameStr, FileBodyBytes) or (None, None)
### pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectDef(inGSettings, inMethodStr, inURLStr, inMatchTypeStr, inDef, inContentTypeStr='application/octet-stream')
> Connect URL to DEF

Loading…
Cancel
Save