Skip to content

Commit

Permalink
Add type hints in upload.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolas committed Feb 5, 2025
1 parent 9b8cce8 commit 0fb7179
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.3.1
===================
* Add type hints

0.3.0 (2025-02-05)
===================
* Revised manifest XML to match Panopto's example format.
Expand Down
8 changes: 4 additions & 4 deletions panopto/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PanoptoUploadTarget(object):
Given uploadTarget =
http[s]://{hostname}/Panopto/Upload/{guid}
'''
def __init__(self, upload_id, upload_target):
def __init__(self, upload_id: str, upload_target: str):
self.upload_id = upload_id
self.upload_target = upload_target

Expand Down Expand Up @@ -145,7 +145,7 @@ def upload_media(self):

source_file.close()

def _panopto_manifest(self, dest_filename, title, descript):
def _panopto_manifest(self, dest_filename: str, title: str, descript: str):
namespace_map = {
None: 'http://tempuri.org/UniversalCaptureSpecification/v1',
'xsi': 'http://www.w3.org/2001/XMLSchema-instance',
Expand Down Expand Up @@ -215,7 +215,7 @@ def complete_session(self):
response = self.session.put(url, json=payload)
return response.status_code == 200

def get_upload_id(self):
def get_upload_id(self) -> str:
return self.target.upload_id


Expand Down Expand Up @@ -269,7 +269,7 @@ def __init__(self):
self.password = None
self.upload_id = None

def check(self):
def check(self) -> tuple[int, str]:
auth = PanoptoAuth(self.server)

self.session = auth.authenticate_with_password(
Expand Down

0 comments on commit 0fb7179

Please sign in to comment.