Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
poezio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
204
Issues
204
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poezio
poezio
Commits
cfc33090
Commit
cfc33090
authored
Jan 09, 2011
by
louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restaure software version and local time
parent
8017b2d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
16 deletions
+13
-16
data/default_config.cfg
data/default_config.cfg
+1
-0
src/common.py
src/common.py
+1
-14
src/connection.py
src/connection.py
+11
-2
No files found.
data/default_config.cfg
View file @
cfc33090
...
...
@@ -133,6 +133,7 @@ send_poezio_info = true
# if true, information about the Operation System you're using
# will be sent when requested by anyone
# Set to false if you don't want people to know these information
# Note that this information will not be sent if send_poezio_info is False
send_os_info = true
# if true, your current time will be sent if asked
...
...
src/common.py
View file @
cfc33090
...
...
@@ -122,19 +122,6 @@ DISTRO_INFO = {
'Redhat Linux'
:
'/etc/redhat-release'
}
def
temp_failure_retry
(
func
,
*
args
,
**
kwargs
):
"""
workaround for a temporary and specific failure
"""
while
True
:
try
:
return
func
(
*
args
,
**
kwargs
)
except
(
os
.
error
,
IOError
,
select
.
error
)
as
ex
:
if
ex
.
errno
==
errno
.
EINTR
:
continue
else
:
raise
def
get_os_info
():
"""
Returns a detailed and well formated string containing
...
...
@@ -151,7 +138,7 @@ def get_os_info():
stdout
=
subprocess
.
PIPE
,
close_fds
=
True
)
process
.
wait
()
output
=
temp_failure_retry
(
process
.
stdout
.
readline
).
strip
()
output
=
process
.
stdout
.
readline
().
decode
(
'utf-8'
).
strip
()
# some distros put n/a in places, so remove those
output
=
output
.
replace
(
'n/a'
,
''
).
replace
(
'N/A'
,
''
)
return
output
...
...
src/connection.py
View file @
cfc33090
...
...
@@ -29,6 +29,7 @@ import sleekxmpp
from
config
import
config
from
logger
import
logger
import
common
class
Connection
(
sleekxmpp
.
ClientXMPP
):
"""
...
...
@@ -48,8 +49,16 @@ class Connection(sleekxmpp.ClientXMPP):
jid
=
'%s/%s'
%
(
config
.
get
(
'server'
,
'anon.louiz.org'
),
resource
)
password
=
None
sleekxmpp
.
ClientXMPP
.
__init__
(
self
,
jid
,
password
,
ssl
=
True
)
self
.
registerPlugin
(
'xep_0030'
)
self
.
registerPlugin
(
'xep_0045'
)
self
.
register_plugin
(
'xep_0030'
)
self
.
register_plugin
(
'xep_0045'
)
if
config
.
get
(
'send_poezio_info'
,
'true'
)
==
'true'
:
info
=
{
'name'
:
'poezio'
,
'version'
:
'0.7-dev'
}
if
config
.
get
(
'send_os_info'
,
'true'
)
==
'true'
:
info
[
'os'
]
=
common
.
get_os_info
()
self
.
register_plugin
(
'xep_0092'
,
pconfig
=
info
)
if
config
.
get
(
'send_time'
,
'true'
)
==
'true'
:
self
.
register_plugin
(
'xep_0202'
)
def
start
(
self
):
# TODO, try multiple servers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment