Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
djrandom-py
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
ale
djrandom-py
Commits
65231d1a
Commit
65231d1a
authored
13 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
use OSError
parent
3fbed3dc
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/djrandom_client/djfuse.py
+4
-4
4 additions, 4 deletions
client/djrandom_client/djfuse.py
with
4 additions
and
4 deletions
client/djrandom_client/djfuse.py
+
4
−
4
View file @
65231d1a
...
...
@@ -4,7 +4,7 @@ import shutil
import
urllib2
from
errno
import
EINVAL
,
ENOENT
from
stat
import
S_IFDIR
,
S_IFREG
from
fuse
import
FUSE
,
FuseOSError
,
Operations
,
LoggingMixIn
from
fuse
import
FUSE
,
Operations
,
LoggingMixIn
class
DJFS
(
LoggingMixIn
,
Operations
):
...
...
@@ -61,7 +61,7 @@ class DJFS(LoggingMixIn, Operations):
def
_parse_path
(
self
,
path
):
parts
=
path
.
split
(
'
/
'
)
if
len
(
parts
)
>
3
:
raise
Fuse
OSError
(
EINVAL
)
raise
OSError
(
EINVAL
)
if
len
(
parts
)
<
3
:
parts
.
extend
([
None
for
x
in
(
3
-
len
(
parts
))])
return
parts
...
...
@@ -71,7 +71,7 @@ class DJFS(LoggingMixIn, Operations):
if
title
:
sha1
=
self
.
_cache_get
(
artist
,
album
,
title
)
if
not
sha1
:
raise
Fuse
OSError
(
ENOENT
)
raise
OSError
(
ENOENT
)
stats
=
self
.
_get
(
'
/json/song/%s
'
%
sha1
)
mtime
=
float
(
stats
[
'
uploaded_at
'
])
return
dict
(
st_mode
=
(
S_IFREG
|
0444
),
st_nlink
=
1
,
...
...
@@ -86,7 +86,7 @@ class DJFS(LoggingMixIn, Operations):
def
readdir
(
self
,
path
,
fh
=
None
):
artist
,
album
,
title
=
self
.
_parse_path
(
path
)
if
title
:
raise
Fuse
OSError
(
EINVAL
)
raise
OSError
(
EINVAL
)
if
not
artist
:
values
=
self
.
_get
(
'
/json/artists
'
)[
'
artists
'
]
elif
not
album
:
...
...
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