Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aura-engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Kruse
aura-engine
Commits
91bda47e
Commit
91bda47e
authored
4 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
Utility to convert URI to actual filepath.
parent
6748bb73
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/base/utils.py
+20
-0
20 additions, 0 deletions
modules/base/utils.py
modules/scheduling/calender_fetcher.py
+0
-16
0 additions, 16 deletions
modules/scheduling/calender_fetcher.py
with
20 additions
and
16 deletions
modules/base/utils.py
+
20
−
0
View file @
91bda47e
...
...
@@ -29,6 +29,9 @@ class EngineUtil:
"""
A class for Engine utilities.
"""
@staticmethod
def
get_channel_type
(
uri
):
"""
...
...
@@ -47,6 +50,23 @@ class EngineUtil:
return
ChannelType
.
LIVE
@staticmethod
def
uri_to_filepath
(
base_dir
,
uri
):
"""
Converts a file-system URI to an actual, absolute path to the file.
Args:
basi_dir (String): The location of the audio store.
uri (String): The URI of the file
Returns:
path (String): Absolute file path
"""
return
base_dir
+
"
/
"
+
uri
[
7
:]
+
"
.flac
"
@staticmethod
def
get_entries_string
(
entries
):
"""
...
...
This diff is collapsed.
Click to expand it.
modules/scheduling/calender_fetcher.py
+
0
−
16
View file @
91bda47e
...
...
@@ -301,22 +301,6 @@ class CalendarFetcher:
def
convert_to_filename
(
self
,
uri
):
"""
Converts a file-system URI to an actual, absolute path to the file.
Args:
uri (String): The URI of the file
Returns:
path (String): Absolute file path
"""
e
=
self
.
config
.
get
(
"
audiofolder
"
)
+
"
/
"
+
uri
[
7
:]
+
"
.flac
"
if
not
os
.
path
.
isfile
(
e
):
self
.
logger
.
warning
(
"
File %s does not exist!
"
%
e
)
return
e
def
__fetch_data__
(
self
,
type
,
url
):
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment