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
65c8646e
Commit
65c8646e
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
spaces and stuff
parent
496baa0f
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/logger.py
+6
-4
6 additions, 4 deletions
src/common/logger.py
with
6 additions
and
4 deletions
src/common/logger.py
+
6
−
4
View file @
65c8646e
...
...
@@ -101,7 +101,7 @@ class Logger:
def
get_jids_already_in_db
(
self
):
self
.
cur
.
execute
(
'
SELECT jid FROM jids
'
)
rows
=
self
.
cur
.
fetchall
()
# list of tupples: (u'aaa@bbb',), (u'cc@dd',)]
rows
=
self
.
cur
.
fetchall
()
# list of tupples:
[
(u'aaa@bbb',), (u'cc@dd',)]
for
row
in
rows
:
# row[0] is first item of row (the only result here, the jid)
self
.
jids_already_in
.
append
(
row
[
0
])
...
...
@@ -130,6 +130,8 @@ class Logger:
logs table has log_id, jid_id, contact_name, time, kind, show, message
so to ask logs we need jid_id that matches our jid in jids table
this method asks jid and returns the jid_id for later sql-ing on logs
typestr can be
'
ROOM
'
or anything else depending on the type of JID
and is only needed to be specified when the JID is new in DB
'''
if
jid
.
find
(
'
/
'
)
!=
-
1
:
# if it has a /
jid_is_from_pm
=
self
.
jid_is_from_pm
(
jid
)
...
...
@@ -364,14 +366,14 @@ class Logger:
constants
.
KIND_STATUS
,
constants
.
KIND_GCSTATUS
))
result
=
self
.
cur
.
fetchall
()
#Copy all interesant time in a temporary table
#
Copy all interesant time in a temporary table
self
.
cur
.
execute
(
'
CREATE TEMPORARY TABLE blabla(time,INTEGER)
'
)
for
line
in
result
:
self
.
cur
.
execute
(
'''
INSERT INTO blabla (time) VALUES (%d)
'''
%
(
line
[
0
]))
#then search in this small temp table for each day
#
then search in this small temp table for each day
for
day
in
xrange
(
1
,
max_day
):
start_of_day
=
self
.
get_unix_time_from_date
(
year
,
month
,
day
)
last_second_of_day
=
start_of_day
+
seconds_in_a_day
-
1
...
...
@@ -386,7 +388,7 @@ class Logger:
if
result
:
list
[
0
:
0
]
=
[
day
]
#Delete temporary table
#
Delete temporary table
self
.
cur
.
execute
(
'
DROP TABLE blabla
'
)
result
=
self
.
cur
.
fetchone
()
return
list
...
...
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