Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gajim-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
gajim
gajim-plugins
Commits
6af5b915
Commit
6af5b915
authored
13 years ago
by
Dicson
Browse files
Options
Downloads
Patches
Plain Diff
hamster. remove unused code
parent
abdf55bd
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
hamster/hamster.py
+10
-14
10 additions, 14 deletions
hamster/hamster.py
with
10 additions
and
14 deletions
hamster/hamster.py
+
10
−
14
View file @
6af5b915
# -*- coding: utf-8 -*-
import
dbus
import
gobject
import
datetime
as
dt
import
gobject
from
common
import
gajim
from
common
import
ged
from
common
import
dbus_support
...
...
@@ -43,21 +43,20 @@ class HamsterIntegrationPlugin(GajimPlugin):
gajim
.
log
.
debug
(
'
Hamster D-Bus service not found
'
)
return
self
.
active
=
True
self
.
bus
.
add_signal_receiver
(
self
.
hamster_facts_changed
,
'
FactsChanged
'
,
HAMSTAER_INTERFACE
)
gajim
.
ged
.
register_event_handler
(
'
our-show
'
,
ged
.
POSTGUI
,
self
.
on_our_status
)
self
.
pep_dict
=
{}
gajim
.
ged
.
register_event_handler
(
'
signed-in
'
,
ged
.
POSTGUI
,
self
.
on_signed_in
)
@log_calls
(
'
HamsterIntegrationPlugin
'
)
def
deactivate
(
self
):
if
not
dbus_support
.
supported
or
not
self
.
active
:
return
self
.
active
=
False
self
.
bus
.
remove_signal_receiver
(
self
.
hamster_facts_changed
,
"
FactsChanged
"
,
dbus_interface
=
HAMSTAER_INTERFACE
)
self
.
bus
.
remove_signal_receiver
(
self
.
hamster_facts_changed
,
"
FactsChanged
"
,
dbus_interface
=
HAMSTAER_INTERFACE
)
gajim
.
ged
.
remove_event_handler
(
'
signed-in
'
,
ged
.
POSTGUI
,
self
.
on_signed_in
)
def
hamster_facts_changed
(
self
,
*
args
,
**
kw
):
# get hamster tags
...
...
@@ -86,8 +85,7 @@ class HamsterIntegrationPlugin(GajimPlugin):
subactivity
=
list
(
subactivity_candidates
)[
0
]
# send activity
accounts
=
gajim
.
connections
.
keys
()
for
account
in
accounts
:
for
account
in
gajim
.
connections
:
if
gajim
.
account_is_connected
(
account
):
connection
=
gajim
.
connections
[
account
]
connection
.
send_activity
(
activity
,
subactivity
,
...
...
@@ -107,7 +105,5 @@ class HamsterIntegrationPlugin(GajimPlugin):
seconds
=
fact
[
9
]
%
(
24
*
60
*
60
)),
id
=
fact
[
0
])
def
on_our_status
(
self
,
network_event
):
gajim
.
ged
.
remove_event_handler
(
'
our-show
'
,
ged
.
POSTGUI
,
self
.
on_our_status
)
gobject
.
timeout_add
(
10000
,
self
.
hamster_facts_changed
)
def
on_signed_in
(
self
,
network_event
):
gobject
.
timeout_add
(
5000
,
self
.
hamster_facts_changed
)
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