Merge pull request #91 from JSchmie/fix_transcript_class
fixed variable name
This commit is contained in:
@@ -12,7 +12,7 @@ jobs:
|
|||||||
- name: Mirror + trigger CI
|
- name: Mirror + trigger CI
|
||||||
uses: SvanBoxel/gitlab-mirror-and-ci-action@master
|
uses: SvanBoxel/gitlab-mirror-and-ci-action@master
|
||||||
with:
|
with:
|
||||||
args: "https://git-dmz.thuenen.de/kida/i2-skills-beratungsstelle/scraibe"
|
args: "https://git-dmz.thuenen.de/kida/i2-skills-beratungsstelle/active-service-requests/scraibe/scraibe"
|
||||||
env:
|
env:
|
||||||
FOLLOW_TAGS: "true"
|
FOLLOW_TAGS: "true"
|
||||||
FORCE_PUSH: "true"
|
FORCE_PUSH: "true"
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ class Transcript:
|
|||||||
raise ValueError("Unknown file format")
|
raise ValueError("Unknown file format")
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_json(cls, json: Union[dict, str]) -> "Transcript":
|
def from_json(cls, _json: Union[dict, str]) -> "Transcript":
|
||||||
"""Load transcript from json file
|
"""Load transcript from json file
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@@ -309,13 +309,13 @@ class Transcript:
|
|||||||
Returns:
|
Returns:
|
||||||
Transcript: Transcript object
|
Transcript: Transcript object
|
||||||
"""
|
"""
|
||||||
if isinstance(json, dict):
|
if isinstance(_json, dict):
|
||||||
return cls(json)
|
return cls(_json)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
transcript = json.loads(json)
|
transcript = json.loads(_json)
|
||||||
except (TypeError, JSONDecodeError):
|
except (TypeError, JSONDecodeError):
|
||||||
with open(json, "r") as f:
|
with open(_json, "r") as f:
|
||||||
transcript = json.load(f)
|
transcript = json.load(f)
|
||||||
|
|
||||||
return cls(transcript)
|
return cls(transcript)
|
||||||
|
|||||||
Reference in New Issue
Block a user