Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
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
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
l-n-s
gajim
Commits
6867d3cc
Commit
6867d3cc
authored
14 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
use shutil.move instead of os.rename to move files. Fixes #6770
parent
23d3d79f
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
src/common/check_paths.py
+16
-15
16 additions, 15 deletions
src/common/check_paths.py
with
16 additions
and
15 deletions
src/common/check_paths.py
+
16
−
15
View file @
6867d3cc
...
...
@@ -24,6 +24,7 @@
##
import
os
import
shutil
import
sys
import
stat
...
...
@@ -248,13 +249,11 @@ def check_and_possibly_move_config():
if
not
os
.
path
.
exists
(
src
):
continue
print
'
moving %s to %s
'
%
(
src
,
dst
)
os
.
renames
(
src
,
dst
)
shutil
.
move
(
src
,
dst
)
gajim
.
logger
.
init_vars
()
gajim
.
logger
.
attach_cache_database
()
def
check_and_possibly_create_paths
():
check_and_possibly_move_config
()
LOG_DB_PATH
=
logger
.
LOG_DB_PATH
LOG_DB_FOLDER
,
LOG_DB_FILE
=
os
.
path
.
split
(
LOG_DB_PATH
)
...
...
@@ -312,11 +311,10 @@ def check_and_possibly_create_paths():
print
_
(
'
Gajim will now exit
'
)
sys
.
exit
()
if
not
os
.
path
.
exists
(
LOG_DB_PATH
):
create_log_db
()
gajim
.
logger
.
init_vars
()
elif
os
.
path
.
isdir
(
LOG_DB_PATH
):
print
_
(
'
%s is a directory but should be a file
'
)
%
LOG_DB_PATH
if
not
os
.
path
.
exists
(
PLUGINS_CONFIG_PATH
):
create_path
(
PLUGINS_CONFIG_PATH
)
elif
os
.
path
.
isfile
(
PLUGINS_CONFIG_PATH
):
print
_
(
'
%s is a file but it should be a directory
'
)
%
PLUGINS_CONFIG_PATH
print
_
(
'
Gajim will now exit
'
)
sys
.
exit
()
...
...
@@ -327,6 +325,16 @@ def check_and_possibly_create_paths():
print
_
(
'
Gajim will now exit
'
)
sys
.
exit
()
check_and_possibly_move_config
()
if
not
os
.
path
.
exists
(
LOG_DB_PATH
):
create_log_db
()
gajim
.
logger
.
init_vars
()
elif
os
.
path
.
isdir
(
LOG_DB_PATH
):
print
_
(
'
%s is a directory but should be a file
'
)
%
LOG_DB_PATH
print
_
(
'
Gajim will now exit
'
)
sys
.
exit
()
if
not
os
.
path
.
exists
(
CACHE_DB_PATH
):
create_cache_db
()
gajim
.
logger
.
attach_cache_database
()
...
...
@@ -335,13 +343,6 @@ def check_and_possibly_create_paths():
print
_
(
'
Gajim will now exit
'
)
sys
.
exit
()
if
not
os
.
path
.
exists
(
PLUGINS_CONFIG_PATH
):
create_path
(
PLUGINS_CONFIG_PATH
)
elif
os
.
path
.
isfile
(
PLUGINS_CONFIG_PATH
):
print
_
(
'
%s is a file but it should be a directory
'
)
%
PLUGINS_CONFIG_PATH
print
_
(
'
Gajim will now exit
'
)
sys
.
exit
()
def
create_path
(
directory
):
head
,
tail
=
os
.
path
.
split
(
directory
)
if
not
os
.
path
.
exists
(
head
):
...
...
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