Skip to content

Commit

Permalink
Changes on the package
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelob committed Jan 27, 2022
1 parent 3759917 commit 7bfb3b8
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 4 deletions.
Binary file added .DS_Store
Binary file not shown.
36 changes: 36 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

.github/workflows/python-publish.yml
Binary file added packet/.DS_Store
Binary file not shown.
Binary file added packet/Alpha-1.1.zip
Binary file not shown.
33 changes: 29 additions & 4 deletions packet/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from numpy import character
from S7comm import mainS7comm
import os

def clearScreen():
clear = lambda: os.system('clear')
clear()

def intro():
display = \
Expand Down Expand Up @@ -37,8 +42,9 @@ def menuS7Comm():


if __name__ == "__main__":
intro()
while(True):
clearScreen()
intro()
menu()
option = ''
try:
Expand All @@ -48,6 +54,7 @@ def menuS7Comm():
#Check what choice was entered and act accordingly
if option == 1:
while(True):
clearScreen()
menuS7Comm()
try:
choice = int(input('Enter your choice: '))
Expand All @@ -60,9 +67,27 @@ def menuS7Comm():
RACK = int(input('Please, type in the RACK number (defult is set to 0): '))
SLOT = int(input('Please, type in the SLOT number (default is set to 1): '))
mainS7comm.labProject(IP,RACK,SLOT)
elif option == 5:

elif choice == 2:
print("Now you will be asked to type in the dst IP, RACK and SLOT.\n")
print("No error will be corrected, please make sure you type in valid values.\n")
IP = str(input('Please, type in the destination IP: '))
HEX = str(input('Please, type in the hex dump of the packet you want to send: '))

mainS7comm.packetReplay(IP,HEX)

elif choice == 3:
print("Now you will be asked to type in the dst IP, RACK and SLOT.\n")
print("No error will be corrected, please make sure you type in valid values.\n")
IP = str(input('Please, type in the destination IP: '))
RACK = int(input('Please, type in the RACK number (defult is set to 0): '))
SLOT = int(input('Please, type in the SLOT number (default is set to 1): '))

mainS7comm.QReadWrite(IP,RACK,SLOT)

elif choice == 4:
print('Thanks message before exiting')
exit()
break
else:
print('Invalid option. Please enter a number between 1 and 4.\n\n')

Expand All @@ -73,7 +98,7 @@ def menuS7Comm():
elif option == 4:
P&P()
elif option == 5:
print('Thanks message before exiting')
print('Thanks for using the package. For more info, refer to the GitHub Repo.')
exit()
else:
print('Invalid option. Please enter a number between 1 and 5.\n\n')
Expand Down

0 comments on commit 7bfb3b8

Please sign in to comment.