diff --git a/.idea/backend.iml b/.idea/backend.iml
index dd8c9ae..feaaf6c 100644
--- a/.idea/backend.iml
+++ b/.idea/backend.iml
@@ -17,8 +17,13 @@
-
+
+
+
+
+
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 890219e..c49b055 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -3,5 +3,8 @@
-
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
index e066844..d7d271a 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -2,7 +2,11 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/other.xml b/.idea/other.xml
new file mode 100644
index 0000000..a708ec7
--- /dev/null
+++ b/.idea/other.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 94a25f7..c8e8dc5 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -1,6 +1,10 @@
-
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 4703e77..65ef146 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -2,12 +2,18 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -15,76 +21,151 @@
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- port
+ metadata
+ UploadFiles(
+ api
+ get_api
+ alternate_user
+ DIVA_INGEST_SESSIONS
+ chunked_upload
+ diva_create_asset
+ getin
+ ingesti
+ api_v1
+ newsItems
+ expect
+ app
+ logger
+ dumps
+ create_user
+ move_media_from_user_to_user
+ DIVA_INGEST_USER_BASE_NAME
+ index
+ get_ingest_user_name_pw
+ other_roles
+ other_ro
+ _build
+ genre
+ roles
+ author
+ nested
+ _build_asset_dict
+ esc
+
+
+
-
+
@@ -92,42 +173,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
@@ -150,7 +251,112 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -166,6 +372,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -178,22 +400,24 @@
1556266469460
+
+
-
+
-
+
-
+
-
+
@@ -201,9 +425,9 @@
-
+
-
+
@@ -215,27 +439,122 @@
+
-
-
+
-
-
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -243,22 +562,192 @@
-
+
-
-
+
+
-
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Pipfile b/Pipfile
index 8dbf92c..7632ec7 100644
--- a/Pipfile
+++ b/Pipfile
@@ -21,7 +21,7 @@ flask-pyoidc = "*"
python-jose = "*"
flask-jwt-extended = "*"
ssh2-python = "*"
-telnetlib = "*"
+update = "*"
[dev-packages]
diff --git a/Pipfile.lock b/Pipfile.lock
index b4a9ee5..af75197 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
- "sha256": "3c4317b4cad2510995180e361c84a57ba0b8e31f86ab2d8a78dccbd3223bc814"
+ "sha256": "0b4fd0972054dfeecdd89492b1128706d5c26dc7dcdf85f35b9261ccc8b02c7a"
},
"pipfile-spec": 6,
"requires": {
@@ -25,9 +25,9 @@
},
"alembic": {
"hashes": [
- "sha256:828dcaa922155a2b7166c4f36ec45268944e4055c86499bd14319b4c8c0094b7"
+ "sha256:cdb7d98bd5cbf65acd38d70b1c05573c432e6473a82f955cdea541b5c153b0cc"
],
- "version": "==1.0.10"
+ "version": "==1.0.11"
},
"aniso8601": {
"hashes": [
@@ -38,10 +38,10 @@
},
"apispec": {
"hashes": [
- "sha256:0bdfa1c56c0f3ff0ae7ca305c4140e633f467a9c371929018bf2cd85f45ae73f",
- "sha256:71271878a79f636e14056f854bfc35d2d8599eae8d48f1f5123d030b157dfb54"
+ "sha256:427293594699c77753b8fdc6d78d8dfe267c394df5186c236d57f6ef1af95027",
+ "sha256:edad7a67fae5576fd3e97888b05d228573bf75b2dc0d2714d7cea0480662ac19"
],
- "version": "==2.0.0"
+ "version": "==2.0.1"
},
"asn1crypto": {
"hashes": [
@@ -207,10 +207,10 @@
},
"flask-jwt-extended": {
"hashes": [
- "sha256:69d683b51cc85f3a0beb187787e8456a1cfe60e3f8d9da00dc0d7c34e38b698a"
+ "sha256:583a6e363ea51434c4189e35d3832a23949cfa5203d60a8287b6be137a75528d"
],
"index": "pypi",
- "version": "==3.18.2"
+ "version": "==3.19.0"
},
"flask-login": {
"hashes": [
@@ -313,9 +313,9 @@
},
"mako": {
"hashes": [
- "sha256:0cfa65de3a835e87eeca6ac856b3013aade55f49e32515f65d999f91a2324162"
+ "sha256:95ee720cc3453063788515d55bd7ce4a2a77b7b209e4ac70ec5c86091eb02541"
],
- "version": "==1.0.12"
+ "version": "==1.0.13"
},
"markupsafe": {
"hashes": [
@@ -426,9 +426,9 @@
},
"pyjwkest": {
"hashes": [
- "sha256:128e3c81d02993ac4cd7e29ef7aac767d91daa59380e6883ae589092945e4aad"
+ "sha256:5560fd5ba08655f29ff6ad1df1e15dc05abc9d976fcbcec8d2b5167f49b70222"
],
- "version": "==1.4.0"
+ "version": "==1.4.2"
},
"pyjwt": {
"hashes": [
@@ -526,38 +526,36 @@
},
"ssh2-python": {
"hashes": [
- "sha256:286ae90146e1a500891976bfa2bd174df82a99b345583fa26052f2ae3271756a",
- "sha256:37217762a4b71b5a46cc45f06bf5c460a7547262020bf1c147ced30ab0e11e5c",
- "sha256:4bd1e6889a99472ef05459a502f041bfe53453372a235cacccffce74df553b4e",
- "sha256:4c15ee53d0af149634f2d793a5b44293f3f6fe70722cc33a53ddacf5327cabdb",
- "sha256:4e8c82493fc7583cda2714a23aca018562916cc45dd3c6e0ffc5f723f21384e7",
- "sha256:59e6d1a589b69aef5efe03fe692b5600b84aa1f604a451b95c2fefb4ec1821c6",
- "sha256:5b9fe88eceb4a1ace4c55079142b1e9f0dbad86c3c235986af96b809a8f9845f",
- "sha256:5ec53c69e2b3eb6fbc01c58af4097f76e42f3637effd5daf3caea374d723d2d1",
- "sha256:5ed50af9e73aa599fde4bb2357b9911275f02a58214fa3b560529e0b7ff46033",
- "sha256:6167353e631a2f829931046b6267af08593d7ecc19e3dc7724236a5e4042679e",
- "sha256:62934a0c01feb42fa67fdac1b4cebeaeee09c9b509778d4d0edc4f0bcc6980a4",
- "sha256:634a198fb50c4bfb1a9acda34149008661171cc96a7bf01faf692f15f848a90b",
- "sha256:677e7ad1f1792e2cd06f5baf9c850e353fcc514d54195fb402e127062ea6eca2",
- "sha256:68381cac1c01d3bd4164f563516da0228f54be7e57a95de99ce3bb2bb607da4d",
- "sha256:6a2d0bfe1b0990568a6ff2f3d057a4e627749b8a54f47af175dbdcb450bb3761",
- "sha256:7266dc0a19fc8269e2b3930127a59bbdb68d39ff81559c4d7c36fea902fd81a3",
- "sha256:7b2d8cf5cf91fb97744e5d660f276de833aff4253178ffd65d5a9590d4e9ff04",
- "sha256:8ca222576de2d311122479bf1a91ce9d8fa22742564da7da23b2951fde425bc1",
- "sha256:90af6e0713a582173d7b3fd621c9bd59bb8d155bca12426401a98cab4fab01a2",
- "sha256:a7dd3760692e00c882397c940956358f45238c264d14e317aea95c638b6d01c0",
- "sha256:ae916e3822701e6ca78d1857507abe3d1fba1a2658628ed91ad90564eda33078",
- "sha256:aec216637ca9a3e452ae6e43d9bac20702b2b9c4464823c5fbd92b5aca67f9ce",
- "sha256:c2afd7824e094b90283d6bac0e5f2360de4860fe6feae6755f3ed8653eeb10be",
- "sha256:c724fb88d1ffb5a639949c7f16638d6914492843a4a8a66da38b6d32223bcf46",
- "sha256:ca6faa65b28e1d3349a5770390a2ea523915864f0b6590141564184153453210",
- "sha256:d8375952a103b7e47e5684f05a7656a27055fa9278b18587d9628823f0c9604c",
- "sha256:dec556e968109d7f7c7279516f96333e95ef9824e4bfa93fa00b2f3673b2615d",
- "sha256:eb88b6c6615d4369e7f701a1db8268275ecd915fa7ee7c8e02c4684a1f948eec",
- "sha256:f2f46855073419bfbea53ba837f15dfe9c875e175987f09dd1fec99ae7eab47e"
+ "sha256:054f2cab611ddca34095eb78d1ae1f6e29521678c82f0de17f696072a0b924fe",
+ "sha256:097d74684172f163d5025aef316987c1c7acf852d9fb75e4735720c8690adf87",
+ "sha256:0f4555b79e19ca6fdd84a74e85152d375a921d167ed9dc680d05f1f9f5dfc463",
+ "sha256:0fb3d9eca454b2874748c69e7e836ea5c6544f1b7acd87d8a876f99f618c806c",
+ "sha256:180c2728796f777a5856b23e5e1656a15a3e8602b4270348f892599ae5426f45",
+ "sha256:49aaa9d48cf52798d89f466a5e774e9dab8b76dc380b90645fd8d5c6622df177",
+ "sha256:4b5ba1390ff5e8faa6b2409df750e4650de3934c3b76ad707d7b54b477600226",
+ "sha256:57a4452dfc5c7f414de14e32f29e21f680fb8d7bdf94306e5f6bc8c2a235fa7a",
+ "sha256:584f753f0401217a55e70d2ae97a7e5220f4d37993a1bba275c4c5e110d87193",
+ "sha256:692cf27ddc5583da9b07b0f0348f0577579f8d798a0b8e4bf495b8d7f19fc854",
+ "sha256:6dc75bacc37de63aa9c86f9982642982c3a8103297fbbb73543a76e3db9abc6a",
+ "sha256:7a029275e62a1e31333ee7f2f151f661dedfac0345f1108e1a8d0b62e08ddf9b",
+ "sha256:7a3d761c669392e778c24a0eabcf6f1ba48ad68bb3b82a2d98235f56500bc8b0",
+ "sha256:8632684aae2f523e603381cf51a1da134fd5937cf0ae9650b1b9e7b4f328c133",
+ "sha256:8acab66dd73554d2c68abaccf96cdddfc10449ad6c7c273ac4b7a91779d414b2",
+ "sha256:9410b63c2361b2b65a55b5e8dc8187270de0f81e11864a427ad52b82b926bcc9",
+ "sha256:abe29ad01ed2ac4465e61c8de42b6850fca9c87d8792686a2de7c7d06c6eb72d",
+ "sha256:de151500a2a027a29bca3d7196c76008b41bb97db29378f29c4651ba1bcb00e8",
+ "sha256:debc56711643b82ab60a9c8b8cbf2978b65c0293aa7e53557a3c0d1fc57799cf",
+ "sha256:f508144d684b3c3c0f264ce67058f05ae3729ae77cc3a8f2051b442e01594849"
],
"index": "pypi",
- "version": "==0.17.0"
+ "version": "==0.18.0.post1"
+ },
+ "style": {
+ "hashes": [
+ "sha256:6485a4bcb84629341a5fd1587fe3ac4887daa4741f0c8a1d01b9c3c8a263afe7",
+ "sha256:8eb365fc15039b19b728bd4e6e85fb7daf24e7aeeec6a15a666f97484c564005"
+ ],
+ "version": "==1.1.0"
},
"tempita": {
"hashes": [
@@ -565,6 +563,13 @@
],
"version": "==0.5.2"
},
+ "update": {
+ "hashes": [
+ "sha256:a25522b4bf60e3e3c1a3ff3ca3a4f5a328ac4b8ff400fdc9614483147e313323"
+ ],
+ "index": "pypi",
+ "version": "==0.0.1"
+ },
"urllib3": {
"hashes": [
"sha256:b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1",
diff --git a/recorder_adapters/__init__.py b/recorder_adapters/__init__.py
index a89b575..26acea8 100644
--- a/recorder_adapters/__init__.py
+++ b/recorder_adapters/__init__.py
@@ -57,7 +57,7 @@ telnetlib.Telnet.assert_string_in_output = assert_string_in_output
class TelnetAdapter(ABC):
- def __init__(self, address, esc_char = "W"):
+ def __init__(self, address, esc_char="W"):
self.address = address
self.tn = None
self.esc_char = esc_char
diff --git a/recorder_adapters/extron_smp.py b/recorder_adapters/extron_smp.py
index 7dc2141..50b253f 100644
--- a/recorder_adapters/extron_smp.py
+++ b/recorder_adapters/extron_smp.py
@@ -9,7 +9,7 @@ from backend.recorder_adapters import telnetlib, TelnetAdapter
HOST = "172.22.246.207" # Test SMP MZ
USER = "admin"
-PW = "123mzsmpx"
+PW = "123mzsmp"
class SMP(TelnetAdapter):
@@ -249,7 +249,7 @@ class SMP(TelnetAdapter):
File related stuff not implemented. (-> use sftp)
"""
- def set_input(self, input_num:int, channel_num:int):
+ def set_input(self, input_num: int, channel_num: int):
"""
Switches input # (1 to 5) to output channel (1=A [input 1 and 2], 2=B [input 3, 4 and 5])
:param input_num:
@@ -258,10 +258,130 @@ class SMP(TelnetAdapter):
"""
if input_num not in range(1,6):
raise Exception("input_num must be a value between 1 and 5!")
+ if channel_num not in range(1,3):
+ raise Exception("input_num must be a value between 1 and 2!")
+ self.tn.write("{}*{}!\n".format(input_num, channel_num))
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+
+ def get_input(self, channel_num: int):
if channel_num not in range(1,2):
raise Exception("input_num must be a value between 1 and 2!")
+ self.tn.write("{}!\n".format(channel_num))
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+ def set_input_format(self, input_num: int, input_format: int):
+ """
+ Sets the input to the format, where the input_format parameter may be:
+ 1 = YUVp / HDTV (default)
+ 2 = YUVi
+ 3 = Composite
+ :param input_num:
+ :param input_format:
+ :return:
+ """
+ if input_num not in range(1,6):
+ raise Exception("input_num must be a value between 1 and 5!")
+ if input_format not in range(1,4):
+ raise Exception("input_num must be a value between 1 and 3!")
+ self.tn.write("{}*{}\\\n".format(input_num, input_format))
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+ def get_input_format(self, input_num: int):
+ if input_num not in range(1,6):
+ raise Exception("input_num must be a value between 1 and 5!")
+ self.tn.write("{}\\\n".format(input_num))
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+
+ def set_input_name(self, input_num: int, input_name: str):
+ if input_num not in range(1,6):
+ raise Exception("input_num must be a value between 1 and 5!")
+ if len(input_name) > 16:
+ raise Exception("input_name must be not longer than 16 chars")
+ try:
+ input_name.encode('ascii')
+ except UnicodeDecodeError:
+ raise Exception("input_name must only contain ascii characters")
+ self.tn.write("{}{},{}NI\n".format(self.esc_char, input_num, input_name))
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+
+ def get_input_name(self, input_num: int):
+ if input_num not in range(1,6):
+ raise Exception("input_num must be a value between 1 and 5!")
+ self.tn.write("{}{}NI\n".format(self.esc_char, input_num))
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+
+ def get_input_selction_per_channel(self):
+ self.tn.write("32I\n")
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+
+ """
+ Input configuration part skipped
+ """
+
+ def stop_recording(self):
+ self.tn.write("{}Y0RCDR\n".format(self.esc_char))
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+
+ def start_recording(self):
+ self.tn.write("{}Y1RCDR\n".format(self.esc_char))
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+
+ def pause_recording(self):
+ self.tn.write("{}Y2RCDR\n".format(self.esc_char))
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+
+ def get_recording_status(self):
+ """
+ Status may be one of:
+ 0=stop
+ 1=record
+ 2=pause
+ :return: status
+ """
+ self.tn.write("{}YRCDR\n".format(self.esc_char))
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+
+ def extent_recording_time(self, extension_time: int):
+ """
+ Extends a scheduled recording by extension_time minutes
+ :param extension_time: must be an int from 0 to 99
+ :return:
+ """
+ if extension_time not in range(0,100):
+ raise Exception("extension_time must be a value between 0 and 99!")
+ self.tn.write("{}E{}RCDR\n".format(self.esc_char, extension_time))
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+
+ def add_chapter_marker(self):
+ self.tn.write("{}BRCDR\n".format(self.esc_char))
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+
+ def swap_channel_positions(self):
+ self.tn.write("%\n")
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+
+ def get_recording_status_text(self):
+ self.tn.write("I\n")
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+
+ def get_elapsed_recording_time(self):
+ self.tn.write("35I\n")
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+
+ def get_remaining_recording_time(self):
+ self.tn.write("36I\n")
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+
+ def get_recording_destination(self):
+ self.tn.write("37I\n")
+ return TelnetAdapter.get_response_str(self.tn.read_until_non_empty_line())
+
+ """
+ Metadata part skipped
+ """
+
+ def recall_user_preset(self, channel_number, preset_number):
+ pass # TODO
smp = SMP(HOST, PW)
@@ -286,3 +406,7 @@ print(smp.get_file_transfer_config())
print(smp.set_front_panel_lock(0))
print(smp.get_front_panel_lock())
+
+print(smp.get_input_name(1))
+print(smp.get_input_selction_per_channel())
+print(smp.get_recording_status())