Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gajim-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
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
gajim
gajim-plugins
Commits
5a0e6996
Commit
5a0e6996
authored
5 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
[preview] Rename directory vars
parent
dbb8cf21
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
url_image_preview/url_image_preview.py
+9
-11
9 additions, 11 deletions
url_image_preview/url_image_preview.py
url_image_preview/utils.py
+2
-2
2 additions, 2 deletions
url_image_preview/utils.py
with
11 additions
and
13 deletions
url_image_preview/url_image_preview.py
+
9
−
11
View file @
5a0e6996
...
...
@@ -116,16 +116,14 @@ class UrlImagePreviewPlugin(GajimPlugin):
self
.
_session
.
props
.
https_aliases
=
[
'
aesgcm
'
]
self
.
_session
.
props
.
ssl_strict
=
False
self
.
directory
=
os
.
path
.
join
(
configpaths
.
get
(
'
MY_DATA
'
),
'
downloads
'
)
self
.
thumbpath
=
os
.
path
.
join
(
configpaths
.
get
(
'
MY_CACHE
'
),
'
downloads.thumb
'
)
self
.
_orig_dir
=
Path
(
configpaths
.
get
(
'
MY_DATA
'
))
/
'
downloads
'
self
.
_thumb_dir
=
Path
(
configpaths
.
get
(
'
MY_CACHE
'
))
/
'
downloads.thumb
'
if
GLib
.
mkdir_with_parents
(
s
elf
.
directory
,
0o700
)
!=
0
:
log
.
error
(
'
Failed to create: %s
'
,
self
.
directory
)
if
GLib
.
mkdir_with_parents
(
s
tr
(
self
.
_orig_dir
)
,
0o700
)
!=
0
:
log
.
error
(
'
Failed to create: %s
'
,
self
.
_orig_dir
)
if
GLib
.
mkdir_with_parents
(
self
.
thumb
path
,
0o700
)
!=
0
:
log
.
error
(
'
Failed to create: %s
'
,
self
.
directory
)
if
GLib
.
mkdir_with_parents
(
str
(
self
.
_
thumb
_dir
)
,
0o700
)
!=
0
:
log
.
error
(
'
Failed to create: %s
'
,
self
.
_thumb_dir
)
self
.
_migrate_config
()
...
...
@@ -156,7 +154,7 @@ class UrlImagePreviewPlugin(GajimPlugin):
if
len
(
text
.
split
(
'
'
))
>
1
:
# urlparse doesn't recognise spaces as URL delimiter
log
.
debug
(
'
Text is not an uri: %s
'
,
text
[:
15
])
log
.
debug
(
'
Text is not an uri: %s
...
'
,
text
[:
15
])
return
uri
=
text
...
...
@@ -272,8 +270,8 @@ class UrlImagePreviewPlugin(GajimPlugin):
orig_path
,
thumb_path
=
get_image_paths
(
uri
,
urlparts
,
size
,
self
.
directory
,
self
.
thumb
path
)
self
.
_orig_dir
,
self
.
_
thumb
_dir
)
return
Preview
(
uri
,
urlparts
,
orig_path
,
...
...
This diff is collapsed.
Click to expand it.
url_image_preview/utils.py
+
2
−
2
View file @
5a0e6996
...
...
@@ -299,8 +299,8 @@ def get_image_paths(uri, urlparts, size, orig_dir, thumb_dir):
size
,
extension
)
orig_path
=
Path
(
orig_dir
)
/
orig_filename
thumb_path
=
Path
(
thumb_dir
)
/
thumb_filename
orig_path
=
orig_dir
/
orig_filename
thumb_path
=
thumb_dir
/
thumb_filename
return
orig_path
,
thumb_path
...
...
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