Skip to content

Commit

Permalink
Merge pull request #3 from engineerjoe440/develop
Browse files Browse the repository at this point in the history
Fix a few items related to controls
  • Loading branch information
engineerjoe440 authored Dec 17, 2023
2 parents 4debdd7 + dcf4e34 commit 9df817e
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sphinx-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install dependencies
run: |
#pip install -r requirements.txt
pip install -r docsource/sphinxrequires.txt
pip install -r docsource/requirements.txt
- name: Build Sphinx docs
if: success()
run: |
Expand Down
29 changes: 29 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docsource/conf.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
# formats:
# - pdf

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: docsource/requirements.txt
22 changes: 6 additions & 16 deletions docsource/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,12 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import re
# import sys
# print("Build with:", sys.version)
# parent_dir = os.path.dirname(os.getcwd())
# initfile = os.path.join(parent_dir,'selprotopy','__init__.py')
# sys.path.insert(0,parent_dir)
# print(parent_dir)
# # Gather Version Information from Python File
# with open(initfile) as fh:
# file_str = fh.read()
# name = re.search('_name_ = \"(.*)\"', file_str).group(1)
# ver = re.search('_version_ = \"(.*)\"', file_str).group(1)
# # Version Breakdown:
# # MAJOR CHANGE . MINOR CHANGE . MICRO CHANGE
# print("Sphinx HTML Build For:",name," Version:",ver)
import os
import sys
print("Build with:", sys.version)
parent_dir = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(0,parent_dir)
print(parent_dir)


# Verify Import
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion selprotopy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from selprotopy.support import telnet

# Describe Package for External Interpretation
__version__ = "0.1.1"
__version__ = "0.1.2"

# `telnetlib` Discards Null Characters, but SEL Protocol Requires them
telnetlib.Telnet.process_rawq = telnet.process_rawq
6 changes: 5 additions & 1 deletion selprotopy/protocol/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ def prepare_fastop_command(
raise InvalidControlType("Invalid control type described.")
command_string += bytes([6]) # Length (in bytes)
try:
control = fastop_def['remotebitconfig'][control_point-1][str(command)]
try:
command_opt = command.value
except AttributeError:
command_opt = str(command)
control = fastop_def['remotebitconfig'][control_point-1][command_opt]
print("control", control)
except KeyError as err:
raise ValueError("Improper command type for control point.") from err
Expand Down
4 changes: 3 additions & 1 deletion selprotopy/protocol/parser/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
from selprotopy.common import ieee_4_byte_fps

# Define Clean Prompt Characters for RegEx
RE_CLEAN_PROMPT_CHARS = re.compile(r'\=\r\n')
RE_CLEAN_PROMPT_CHARS = re.compile(
r'\=\>{0,2}\r\n|\>{0,2}\r\n\=|\r\n\=\>{0,2}|\n\=\>{0,2}\r'
)

# Define DNA Control Character String for RegEx
RE_DNA_CONTROL = re.compile(r'\>?.*DNA')
Expand Down

0 comments on commit 9df817e

Please sign in to comment.