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
eta
gajim
Commits
4f9404e8
Commit
4f9404e8
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
migration is okay now if no ~/.gajim; also many other small fixes
parent
acebad01
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/common/migrate_logs_to_dot9_db.py
+7
-5
7 additions, 5 deletions
src/common/migrate_logs_to_dot9_db.py
src/dialogs.py
+2
-0
2 additions, 0 deletions
src/dialogs.py
src/gajim.py
+12
-11
12 additions, 11 deletions
src/gajim.py
with
21 additions
and
16 deletions
src/common/migrate_logs_to_dot9_db.py
+
7
−
5
View file @
4f9404e8
...
...
@@ -71,7 +71,7 @@ class Migration:
for
filename
in
filenames
:
# Don't take this file into account, this is dup info
# notifications are also in contact log file
if
filename
in
(
'
notify.log
'
,
'
readme
'
):
if
filename
in
(
'
notify.log
'
,
'
README
'
):
continue
path_to_text_file
=
os
.
path
.
join
(
dirname
,
filename
)
if
os
.
path
.
isdir
(
path_to_text_file
):
...
...
@@ -203,11 +203,13 @@ class Migration:
self
.
con
.
commit
()
os
.
path
.
walk
(
PATH_TO_LOGS_BASE_DIR
,
self
.
visit
,
None
)
s
=
'''
We do not use plain-text files anymore, because they do not scale.
s
=
'''
We do not use plain-text files anymore, because they do not meet our needs.
Those files here are logs for Gajim up until 0.8.2
We now use an sqlite database called logs.db found in
~/.gajim
You can now safly remove your %s folder
Thank you
'''
%
PATH_TO_LOGS_BASE_DIR
We now use an sqlite database called logs.db found in
%s
You can now saf
e
ly remove your %s folder
Thank you
'''
%
(
os
.
path
.
dirname
(
PATH_TO_LOGS_BASE_DIR
),
PATH_TO_LOGS_BASE_DIR
)
f
=
open
(
os
.
path
.
join
(
PATH_TO_LOGS_BASE_DIR
,
'
README
'
),
'
w
'
)
f
.
write
(
s
)
f
.
close
()
...
...
This diff is collapsed.
Click to expand it.
src/dialogs.py
+
2
−
0
View file @
4f9404e8
...
...
@@ -1288,6 +1288,7 @@ class ProgressDialog:
self
.
textview_buffer
.
create_mark
(
'
end
'
,
end_iter
,
False
)
self
.
dialog
.
set_title
(
title_text
)
self
.
dialog
.
set_default_size
(
450
,
500
)
self
.
dialog
.
show_all
()
self
.
xml
.
signal_autoconnect
(
self
)
...
...
@@ -1321,3 +1322,4 @@ class ProgressDialog:
gobject
.
source_remove
(
self
.
update_progressbar_timeout_id
)
gobject
.
source_remove
(
self
.
read_from_queue_id
)
self
.
read_from_queue_and_update_textview
()
self
.
progressbar
.
set_fraction
(
1
)
This diff is collapsed.
Click to expand it.
src/gajim.py
+
12
−
11
View file @
4f9404e8
...
...
@@ -1397,7 +1397,7 @@ class Interface:
def
wait_migration
(
migration
):
if
not
migration
.
DONE
:
return
True
return
True
# loop for ever
dialog
.
done
(
_
(
'
Logs have been successfully migrated to the database.
'
))
dialog
.
dialog
.
run
()
dialog
.
dialog
.
destroy
()
...
...
@@ -1463,19 +1463,20 @@ if __name__ == '__main__':
except
:
pass
# Migrate old logs if
user wants that
# Migrate old logs if
we have such olds logs
from
common
import
logger
LOG_DB_PATH
=
logger
.
LOG_DB_PATH
if
not
os
.
path
.
isfile
(
LOG_DB_PATH
):
import
Queue
q
=
Queue
.
Queue
(
100
)
if
not
os
.
path
.
exists
(
LOG_DB_PATH
):
from
common
import
migrate_logs_to_dot9_db
m
=
migrate_logs_to_dot9_db
.
Migration
()
dialog
=
dialogs
.
ProgressDialog
(
_
(
'
Migrating logs...
'
),
_
(
'
Please wait while logs are being migrated...
'
),
q
)
t
=
threading
.
Thread
(
target
=
m
.
migrate
,
args
=
(
q
,))
t
.
start
()
gobject
.
timeout_add
(
500
,
wait_migration
,
m
)
gtk
.
main
()
if
os
.
path
.
isdir
(
migrate_logs_to_dot9_db
.
PATH_TO_LOGS_BASE_DIR
):
import
Queue
q
=
Queue
.
Queue
(
100
)
m
=
migrate_logs_to_dot9_db
.
Migration
()
dialog
=
dialogs
.
ProgressDialog
(
_
(
'
Migrating Logs...
'
),
_
(
'
Please wait while logs are being migrated...
'
),
q
)
t
=
threading
.
Thread
(
target
=
m
.
migrate
,
args
=
(
q
,))
t
.
start
()
gobject
.
timeout_add
(
500
,
wait_migration
,
m
)
gtk
.
main
()
check_paths
.
check_and_possibly_create_paths
()
Interface
()
...
...
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