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
5c615f53
Commit
5c615f53
authored
18 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
clean logs table so that show field contains only 0, 1, 2, 3, 4, 5 values
parent
18296324
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/config.py
+1
-1
1 addition, 1 deletion
src/common/config.py
src/common/optparser.py
+28
-7
28 additions, 7 deletions
src/common/optparser.py
with
29 additions
and
8 deletions
src/common/config.py
+
1
−
1
View file @
5c615f53
...
...
@@ -141,7 +141,7 @@ class Config:
'
send_on_ctrl_enter
'
:
[
opt_bool
,
False
,
_
(
'
Send message on Ctrl+Enter and with Enter make new line (Mirabilis ICQ Client default behaviour).
'
)],
'
show_roster_on_startup
'
:
[
opt_bool
,
True
],
'
key_up_lines
'
:
[
opt_int
,
25
,
_
(
'
How many lines to store for Ctrl+KeyUP.
'
)],
'
version
'
:
[
opt_str
,
'
0.10.1.
4
'
],
# which version created the config
'
version
'
:
[
opt_str
,
'
0.10.1.
5
'
],
# which version created the config
'
search_engine
'
:
[
opt_str
,
'
http://www.google.com/search?&q=%s&sourceid=gajim
'
],
'
dictionary_url
'
:
[
opt_str
,
'
WIKTIONARY
'
,
_
(
"
Either custom url with %s in it where %s is the word/phrase or
'
WIKTIONARY
'
which means use wiktionary.
"
)],
'
always_english_wikipedia
'
:
[
opt_bool
,
False
],
...
...
This diff is collapsed.
Click to expand it.
src/common/optparser.py
+
28
−
7
View file @
5c615f53
...
...
@@ -147,6 +147,8 @@ class OptionsParser:
self
.
update_config_to_01013
()
if
old
<
[
0
,
10
,
1
,
4
]
and
new
>=
[
0
,
10
,
1
,
4
]:
self
.
update_config_to_01014
()
if
old
<
[
0
,
10
,
1
,
5
]
and
new
>=
[
0
,
10
,
1
,
5
]:
self
.
update_config_to_01015
()
gajim
.
logger
.
init_vars
()
gajim
.
config
.
set
(
'
version
'
,
new_version
)
...
...
@@ -315,13 +317,32 @@ class OptionsParser:
con
=
sqlite
.
connect
(
logger
.
LOG_DB_PATH
)
cur
=
con
.
cursor
()
# apply indeces
cur
.
executescript
(
'''
CREATE INDEX idx_logs_jid_id_kind ON logs (jid_id, kind);
CREATE INDEX idx_unread_messages_jid_id ON unread_messages (jid_id);
'''
)
try
:
cur
.
executescript
(
'''
CREATE INDEX idx_logs_jid_id_kind ON logs (jid_id, kind);
CREATE INDEX idx_unread_messages_jid_id ON unread_messages (jid_id);
'''
)
con
.
commit
()
con
.
commit
()
except
:
pass
con
.
close
()
gajim
.
config
.
set
(
'
version
'
,
'
0.10.1.4
'
)
def
update_config_to_01015
(
self
):
'''
clean show values in logs database
'''
from
pysqlite2
import
dbapi2
as
sqlite
import
logger
con
=
sqlite
.
connect
(
logger
.
LOG_DB_PATH
)
cur
=
con
.
cursor
()
status
=
dict
((
i
[
5
:].
lower
(),
logger
.
constants
.
__dict__
[
i
])
for
i
in
\
logger
.
constants
.
__dict__
.
keys
()
if
i
.
startswith
(
'
SHOW_
'
))
for
show
in
status
:
cur
.
execute
(
'
update logs set show = ? where show = ?;
'
,
(
status
[
show
],
show
))
cur
.
executescript
(
'
update logs set show = NULL where show not in (0, 1, 2, 3, 4, 5);
'
)
con
.
commit
()
con
.
close
()
gajim
.
config
.
set
(
'
version
'
,
'
0.10.1.5
'
)
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