Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
1f43d223
Commit
1f43d223
authored
7 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Don't needlessly rename variable
parent
a675bd08
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/rest/media/v1/filepath.py
+13
-13
13 additions, 13 deletions
synapse/rest/media/v1/filepath.py
with
13 additions
and
13 deletions
synapse/rest/media/v1/filepath.py
+
13
−
13
View file @
1f43d223
...
...
@@ -27,7 +27,7 @@ def _wrap_in_base_path(func):
@functools.wraps
(
func
)
def
_wrapped
(
self
,
*
args
,
**
kwargs
):
path
=
func
(
self
,
*
args
,
**
kwargs
)
return
os
.
path
.
join
(
self
.
primary_
base_path
,
path
)
return
os
.
path
.
join
(
self
.
base_path
,
path
)
return
_wrapped
...
...
@@ -41,7 +41,7 @@ class MediaFilePaths(object):
"""
def
__init__
(
self
,
primary_base_path
):
self
.
primary_
base_path
=
primary_base_path
self
.
base_path
=
primary_base_path
def
default_thumbnail_rel
(
self
,
default_top_level
,
default_sub_type
,
width
,
height
,
content_type
,
method
):
...
...
@@ -100,7 +100,7 @@ class MediaFilePaths(object):
def
remote_media_thumbnail_dir
(
self
,
server_name
,
file_id
):
return
os
.
path
.
join
(
self
.
primary_
base_path
,
"
remote_thumbnail
"
,
server_name
,
self
.
base_path
,
"
remote_thumbnail
"
,
server_name
,
file_id
[
0
:
2
],
file_id
[
2
:
4
],
file_id
[
4
:],
)
...
...
@@ -125,18 +125,18 @@ class MediaFilePaths(object):
if
NEW_FORMAT_ID_RE
.
match
(
media_id
):
return
[
os
.
path
.
join
(
self
.
primary_
base_path
,
"
url_cache
"
,
self
.
base_path
,
"
url_cache
"
,
media_id
[:
10
],
),
]
else
:
return
[
os
.
path
.
join
(
self
.
primary_
base_path
,
"
url_cache
"
,
self
.
base_path
,
"
url_cache
"
,
media_id
[
0
:
2
],
media_id
[
2
:
4
],
),
os
.
path
.
join
(
self
.
primary_
base_path
,
"
url_cache
"
,
self
.
base_path
,
"
url_cache
"
,
media_id
[
0
:
2
],
),
]
...
...
@@ -172,12 +172,12 @@ class MediaFilePaths(object):
if
NEW_FORMAT_ID_RE
.
match
(
media_id
):
return
os
.
path
.
join
(
self
.
primary_
base_path
,
"
url_cache_thumbnails
"
,
self
.
base_path
,
"
url_cache_thumbnails
"
,
media_id
[:
10
],
media_id
[
11
:],
)
else
:
return
os
.
path
.
join
(
self
.
primary_
base_path
,
"
url_cache_thumbnails
"
,
self
.
base_path
,
"
url_cache_thumbnails
"
,
media_id
[
0
:
2
],
media_id
[
2
:
4
],
media_id
[
4
:],
)
...
...
@@ -188,26 +188,26 @@ class MediaFilePaths(object):
if
NEW_FORMAT_ID_RE
.
match
(
media_id
):
return
[
os
.
path
.
join
(
self
.
primary_
base_path
,
"
url_cache_thumbnails
"
,
self
.
base_path
,
"
url_cache_thumbnails
"
,
media_id
[:
10
],
media_id
[
11
:],
),
os
.
path
.
join
(
self
.
primary_
base_path
,
"
url_cache_thumbnails
"
,
self
.
base_path
,
"
url_cache_thumbnails
"
,
media_id
[:
10
],
),
]
else
:
return
[
os
.
path
.
join
(
self
.
primary_
base_path
,
"
url_cache_thumbnails
"
,
self
.
base_path
,
"
url_cache_thumbnails
"
,
media_id
[
0
:
2
],
media_id
[
2
:
4
],
media_id
[
4
:],
),
os
.
path
.
join
(
self
.
primary_
base_path
,
"
url_cache_thumbnails
"
,
self
.
base_path
,
"
url_cache_thumbnails
"
,
media_id
[
0
:
2
],
media_id
[
2
:
4
],
),
os
.
path
.
join
(
self
.
primary_
base_path
,
"
url_cache_thumbnails
"
,
self
.
base_path
,
"
url_cache_thumbnails
"
,
media_id
[
0
:
2
],
),
]
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