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
d4f0994f
Commit
d4f0994f
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
commit a missing file; revert one that hsould be commited [sorry]
parent
59050d41
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/gajim.py
+0
-1
0 additions, 1 deletion
src/common/gajim.py
src/common/logger.py
+20
-20
20 additions, 20 deletions
src/common/logger.py
with
20 additions
and
21 deletions
src/common/gajim.py
+
0
−
1
View file @
d4f0994f
...
...
@@ -84,7 +84,6 @@ def get_contact_instances_from_jid(account, jid):
return
contacts_instances
def
get_first_contact_instance_from_jid
(
account
,
jid
):
print
'
jIIIIIIIIIIIIIIIIIIID
'
,
jid
if
jid
in
contacts
[
account
]:
contact
=
contacts
[
account
][
jid
][
0
]
else
:
# it's fake jid
...
...
This diff is collapsed.
Click to expand it.
src/common/logger.py
+
20
−
20
View file @
d4f0994f
...
...
@@ -116,12 +116,12 @@ class Logger:
show
=
nick
for
f
in
files
:
path_to_file
=
os
.
path
.
join
(
LOGPATH
,
f
)
fi
c
=
open
(
path_to_file
,
'
a
'
)
fi
c
.
write
(
'
%s:%s:%s
'
%
(
tim
,
jid
,
show
))
fi
l
=
open
(
path_to_file
,
'
a
'
)
fi
l
.
write
(
'
%s:%s:%s
'
%
(
tim
,
jid
,
show
))
if
msg
:
fi
c
.
write
(
'
:
'
+
msg
)
fi
c
.
write
(
'
\n
'
)
fi
c
.
close
()
fi
l
.
write
(
'
:
'
+
msg
)
fi
l
.
write
(
'
\n
'
)
fi
l
.
close
()
def
__get_path_to_file
(
self
,
fjid
):
jid
=
fjid
.
split
(
'
/
'
)[
0
]
...
...
@@ -133,18 +133,18 @@ class Logger:
path_to_file
=
os
.
path
.
join
(
LOGPATH
,
fjid
)
return
path_to_file
def
get_n
b
_line
(
self
,
fjid
):
def
get_n
o_of
_line
s
(
self
,
fjid
):
'''
return total number of lines in a log file
return 0 if log file does not exist
'''
path_to_file
=
self
.
__get_path_to_file
(
fjid
)
if
not
os
.
path
.
exists
(
path_to_file
):
return
0
fi
c
=
open
(
path_to_file
,
'
r
'
)
n
b
=
0
# number of lines
while
fi
c
.
readline
():
n
b
+=
1
fi
c
.
close
()
return
n
b
fi
l
=
open
(
path_to_file
,
'
r
'
)
n
o_of_lines
=
0
# number of lines
while
fi
l
.
readline
():
n
o_of_lines
+=
1
fi
l
.
close
()
return
n
o_of_lines
def
read
(
self
,
fjid
,
begin_line
,
end_line
):
'''
return number of lines read and the text in the lines
...
...
@@ -152,17 +152,17 @@ class Logger:
path_to_file
=
self
.
__get_path_to_file
(
fjid
)
if
not
os
.
path
.
exists
(
path_to_file
):
return
0
,
[]
fi
c
=
open
(
path_to_file
,
'
r
'
)
n
b
=
0
# number of lines
fi
l
=
open
(
path_to_file
,
'
r
'
)
n
o_of_lines
=
0
# number of lines
lines
=
[]
while
(
n
b
<
begin_line
and
fi
c
.
readline
()):
n
b
+=
1
while
n
b
<
end_line
:
line
=
fi
c
.
readline
()
while
(
n
o_of_lines
<
begin_line
and
fi
l
.
readline
()):
n
o_of_lines
+=
1
while
n
o_of_lines
<
end_line
:
line
=
fi
l
.
readline
()
if
line
:
line
=
helpers
.
from_one_line
(
line
)
lineSplited
=
line
.
split
(
'
:
'
)
if
len
(
lineSplited
)
>
2
:
lines
.
append
(
lineSplited
)
n
b
+=
1
return
n
b
,
lines
n
o_of_lines
+=
1
return
n
o_of_lines
,
lines
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