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
Weblate
gajim
Commits
70191a19
Commit
70191a19
authored
19 years ago
by
dkirov
Browse files
Options
Downloads
Patches
Plain Diff
added command account_info
parent
d19ce874
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/gajim-remote.py
+15
-4
15 additions, 4 deletions
src/gajim-remote.py
src/remote_control.py
+23
-2
23 additions, 2 deletions
src/remote_control.py
with
38 additions
and
6 deletions
src/gajim-remote.py
+
15
−
4
View file @
70191a19
...
...
@@ -142,6 +142,12 @@ class GajimRemote:
(
'
jid
'
,
_
(
'
JID of the contact
'
),
True
)
]
],
'
account_info
'
:
[
_
(
'
Gets detailed info on a account
'
),
[
(
'
account
'
,
_
(
'
Name of the account
'
),
True
)
]
],
'
send_file
'
:
[
_
(
'
Sends file to a contact
'
),
[
...
...
@@ -252,6 +258,9 @@ class GajimRemote:
if
isinstance
(
res
,
list
):
for
account
in
res
:
print
account
elif
self
.
command
==
'
account_info
'
:
if
res
:
print
self
.
print_info
(
0
,
self
.
unrepr
(
res
)[
0
])
elif
self
.
command
==
'
list_contacts
'
:
for
single_res
in
res
:
accounts
=
self
.
unrepr
(
single_res
)
...
...
@@ -382,10 +391,12 @@ class GajimRemote:
res
=
self
.
print_info
(
level
+
1
,
val
)
if
res
!=
''
:
ret_str
+=
'
%s%s:
\n
%s
'
%
(
spacing
,
key
,
res
)
if
isinstance
(
ret_str
,
unicode
):
return
ret_str
.
encode
(
locale
.
getpreferredencoding
())
else
:
return
ret_str
# utf-8 string come from gajim
# FIXME: why we have strings instead of unicode?
if
isinstance
(
ret_str
,
str
):
ret_str
=
ret_str
.
decode
(
'
utf-8
'
)
return
ret_str
.
encode
(
locale
.
getpreferredencoding
())
def
unrepr
(
self
,
serialized_data
):
'''
works the same as eval, but only for structural values,
...
...
This diff is collapsed.
Click to expand it.
src/remote_control.py
+
23
−
2
View file @
70191a19
...
...
@@ -95,6 +95,7 @@ class SignalObject(DbusPrototype):
self
.
show_next_unread
,
self
.
list_contacts
,
self
.
list_accounts
,
self
.
account_info
,
self
.
change_status
,
self
.
open_chat
,
self
.
send_message
,
...
...
@@ -310,10 +311,29 @@ class SignalObject(DbusPrototype):
if
result
and
len
(
result
)
>
0
:
result_array
=
[]
for
account
in
result
:
result_array
.
append
(
account
.
encode
(
'
utf-8
'
)
)
result_array
.
append
(
account
)
return
result_array
return
None
def
account_info
(
self
,
*
args
):
'''
show info on account: resource, jid, nick, prio, message
'''
[
for_account
]
=
self
.
_get_real_arguments
(
args
,
1
)
if
not
gajim
.
connections
.
has_key
(
for_account
):
# account is invalid
return
None
account
=
gajim
.
connections
[
for_account
]
result
=
{}
index
=
account
.
connected
result
[
'
status
'
]
=
STATUS_LIST
[
index
]
result
[
'
name
'
]
=
account
.
name
result
[
'
jid
'
]
=
gajim
.
get_jid_from_account
(
account
.
name
)
result
[
'
message
'
]
=
account
.
status
result
[
'
priority
'
]
=
unicode
(
gajim
.
config
.
get_per
(
'
accounts
'
,
account
.
name
,
'
priority
'
))
result
[
'
resource
'
]
=
unicode
(
gajim
.
config
.
get_per
(
'
accounts
'
,
account
.
name
,
'
resource
'
))
return
repr
(
result
)
def
list_contacts
(
self
,
*
args
):
'''
list all contacts in the roster. If the first argument is specified,
then return the contacts for the specified account
'''
...
...
@@ -499,3 +519,4 @@ class SignalObject(DbusPrototype):
add_contact
=
method
(
INTERFACE
)(
add_contact
)
get_status
=
method
(
INTERFACE
)(
get_status
)
get_status_message
=
method
(
INTERFACE
)(
get_status_message
)
account_info
=
method
(
INTERFACE
)(
account_info
)
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