Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.2.8 #3

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Create Release on QA to Master Merge

on:
pull_request:
branches:
- main
- master
types:
- closed

jobs:
create_release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Read version from package.json
id: get_version
run: echo "VERSION=$(jq -r '.version' package.json)" >> "$GITHUB_OUTPUT"

- name: Read module name
id: get_name
run: echo "MODULE_NAME=$(jq -r '.name' package.json)" >> "$GITHUB_OUTPUT"

- name: Extract commit message
id: extract_commit_message
run: echo "MESSAGE=$(git log --format=%B -n 1 ${{ github.event.pull_request.head.sha }})" >> "$GITHUB_OUTPUT"

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: Release_${{ steps.get_version.outputs.VERSION }}
release_name: Release ${{ steps.get_version.outputs.VERSION }}
body: ${{ steps.extract_commit_message.outputs.MESSAGE }}
draft: false
prerelease: false
- name: Module Information
uses: fjogeleit/http-request-action@v1
id: module_info
with:
url: 'https://market-api.rocketbot.com/modules/${{ steps.get_name.outputs.MODULE_NAME }}'
method: 'POST'

- name: Module ID
id: module_id
run: echo "MODULE_ID=${{ fromJson(steps.module_info.outputs.response).data.id }}" >> "$GITHUB_OUTPUT"

- name: Update module in Market
uses: fjogeleit/http-request-action@v1
id: update_module
with:
url: 'https://market-api.rocketbot.com/modules/update/${{ steps.module_id.outputs.MODULE_ID }}'
method: 'POST'
50 changes: 35 additions & 15 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"moveCursorRight": "moveCursorRight",
"moveCursorUp": "moveCursorUp",
"moveTo": "moveTo",
"home": "moveToFirstInputField",
"tab": "sendTab"
}

Expand All @@ -98,25 +99,29 @@
protocol = GetParams('protocol')
show = GetParams('show')
config = GetParams('config')

model = GetParams('model')
result = GetParams('result')
try:

if not port:
port = '23'
if not config:
config = None

if not model:
model = '3279-2'
path = path = BASE_PATH + 'modules' + os.sep + 'Terminal_emulator' + os.sep + 'bin' + os.sep + "3270" + os.sep
args = {
"hostName": host,
"hostPort": port,
"configFile": config,
"path": path
"path": path,
"verifyCert": "no",
"modelName": model
}

if protocol == "tls":
args["enableTLS"] = "yes"
args["verifyCert"] = "no"

terminal_simulator = create_terminal(terminal_type, **args)
terminal_log_path = LOG_PATH + session + ".txt"
Expand All @@ -127,7 +132,7 @@
}

connected = terminal_simulator.connect()

print("connected: ", connected)
if show and show == "True":
print([APP_PATH, "-l=" + terminal_log_path])
process = subprocess.Popen([APP_PATH, "-l=" + terminal_log_path], shell=True)
Expand Down Expand Up @@ -211,18 +216,27 @@
try:
# This is for Terminal Type 5250
getattr(terminal_simulator, function)(*number)

except:
# This is for Terminal Type 3270
number = number[0]
if 0 < number < 13:
terminal_simulator.p3270.sendPA(1)
terminal_simulator.p3270.sendPF(number)
elif 12 < number < 25:
terminal_simulator.p3270.sendPA(2)
terminal_simulator.p3270.sendPF(number)
number = number[0] if number else None
if number is not None:
if 0 < number < 13:
terminal_simulator.sendPA(1)
terminal_simulator.sendPF(number)
elif 12 < number < 25:
terminal_simulator.sendPA(2)
terminal_simulator.sendPF(number)
else:
getattr(terminal_simulator, function)()
elif params_keys:
for key in params_keys:
terminal_simulator.p3270.s3270.do("Key({})".format(key[0]))
try:
# This is for Terminal Type 5250
terminal_simulator.p3270.s3270.do("Key({})".format(key[0]))
except:
# This is for Terminal Type 3270
terminal_simulator.s3270.do("Key({})".format(key[0]))

if module == "move_cursor":
position = GetParams('position')
Expand Down Expand Up @@ -270,7 +284,12 @@
result = GetParams("result")

screen = terminal_simulator.getScreen
cursor = terminal_simulator.p3270.s3270.statusMsg.cursorPosition
try:
# This is for Terminal Type 5250
cursor = terminal_simulator.p3270.s3270.statusMsg.cursorPosition
except:
# This is for Terminal Type 3270
cursor = terminal_simulator.s3270.statusMsg.cursorPosition
connected = False
now = 0
if option == "appears":
Expand All @@ -286,7 +305,7 @@
while text != cursor() and now - start <= int(wait):
sleep(1)
now = ProcessTime()
if now - start > int(wait):
if now - start < int(wait):
connected = True
if result:
SetVar(result, connected)
Expand All @@ -295,6 +314,7 @@
create_log(terminal_simulator, terminal_log_path)

except Exception as e:
PrintException()
import traceback
traceback.print_exc()
raise e

1 change: 1 addition & 0 deletions docs/Manual_Terminal_emulator.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Conecta con una terminal
|Host||localhost|
|Port||23|
|Tipo de terminal|||
|Modelo de terminal|||
|Protocolo de seguridad|||
|Mostrar terminal|Si se marca, se mostrara una terminal para revisar ejecuciones del robot. Herramienta para desarollo.||
|Archivo de configuración||c:/wc3270/conf.ini|
Expand Down
1 change: 1 addition & 0 deletions docs/Manual_Terminal_emulator.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Connect to terminal
|Host||localhost|
|Port||23|
|Terminal type|||
|Terminal Model|||
|Safety protocol|||
|Show terminal|If checked, a terminal will be displayed to review robot executions. Development tool.||
|Configuration file||c:/wc3270/conf.ino|
Expand Down
Binary file modified example/Manual_Terminal_emulator.pdf
Binary file not shown.
7 changes: 3 additions & 4 deletions libs/p3270/p3270.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ class P3270Client():
configuration file is specified. Default values will be used.
"""
numOfInstances = 0

def __init__(self, luName=None, hostName='localhost', hostPort='23', modelName='3279-2', configFile=None,
verifyCert='yes', enableTLS='no', codePage='cp037', path=None, timeoutInSec=20):
verifyCert='no', enableTLS='no', codePage='cp037', path=None, timeoutInSec=20):
self.luName = luName
self.hostName = hostName
self.hostPort = hostPort
Expand All @@ -101,7 +101,7 @@ def __init__(self, luName=None, hostName='localhost', hostPort='23', modelName='
self.timeout = timeoutInSec
self.path = path
self.conf = Config(cfgFile=self.configFile, hostName=self.hostName,
hostPort=self.hostPort, luName=self.luName, modelName=self.modelName, codePage=codePage)
hostPort=self.hostPort, luName=self.luName, modelName=self.modelName, codePage=codePage, enableTLS=self.enableTLS, verifyCert=self.verifyCert)
if self.conf.isValid():
self.subpro = None
self.makeArgs()
Expand All @@ -117,7 +117,6 @@ def makeArgs(self):
self.args = ['s3270']
if self.path is not None:
self.args = [self.path + 's3270']

if self.conf.isValid():
self.args.append('-model')
self.args.append(self.conf.modelName)
Expand Down
57 changes: 56 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"pr": "Este módulo permite realizar ações em um emulador de terminal, como conectar, enviar texto, enviar chaves, mover o cursor, etc."
},
"disclaimer": "THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.",
"version": "2.2.4",
"version": "2.2.8",
"license": "MIT",
"homepage": "http://rocketbot.com",
"linux": true,
Expand Down Expand Up @@ -99,6 +99,57 @@
"id": "type",
"css": "col-md-4"
},
{
"type": "select",
"options": [
{
"title": "--Seleccione--",
"value": ""
},
{
"title": "3278-2 (80x24)",
"value": "3278-2"
},
{
"title": "3278-3 (80x32)",
"value": "3278-3"
},
{
"title": "3278-4 (80x43)",
"value": "3278-4"
},
{
"title": "3278-5 (132x27)",
"value": "3278-5"
},
{
"title": "3279-2 (80x24)",
"value": "3279-2"
},
{
"title": "3279-3 (80x32)",
"value": "3279-3"
},
{
"title": "3279-4 (80x43)",
"value": "3279-4"
},
{
"title": "3279-5 (132x27)",
"value": "3279-5"
}
],
"title": {
"es": "Modelo de terminal",
"en": "Terminal Model"
},
"help": {
"es": "Por defecto 3279-2. El modelo base 3278 es una pantalla 3270 verde sobre negro, mientras que el modelo base 3279 es una pantalla 3270 a color. Los números de modelo se utilizan para especificar la definición de la pantalla (filas y columnas).",
"en": "By default 3279-2. The base model 3278 is a green on black 3270 display, whereas 3279 base model is a color 3270 display. Model numbers are used to specify the screen definition (rows and columns)."
},
"id": "model",
"css": "col-md-4"
},
{
"type": "select",
"options": [
Expand Down Expand Up @@ -289,6 +340,10 @@
"title": "--Seleccione--",
"value": ""
},
{
"title": "Home",
"value": "home"
},
{
"title": "BackSpace",
"value": "backSpace"
Expand Down
Loading