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
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
Evert Mouw
gajim-plugins
Commits
eccb3b88
Commit
eccb3b88
authored
13 years ago
by
Dicson
Browse files
Options
Downloads
Patches
Plain Diff
Set Location.Do not ignore 'Pablish location' parametr
parent
735e0165
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
set_location/manifest.ini
+1
-2
1 addition, 2 deletions
set_location/manifest.ini
set_location/set_location.py
+23
-9
23 additions, 9 deletions
set_location/set_location.py
with
24 additions
and
11 deletions
set_location/manifest.ini
+
1
−
2
View file @
eccb3b88
[info]
name:
Set
Location
short_name:
set_location
version:
0.
6
version:
0.
7
description:
Set
information
about
the
current
geographical
or
physical
location.
To
be
able
to
specify
a
location
on
the
built-in
card,
you
must
install
python-osmgpsmap
>
0.5
authors:
Denis
Fomin
<fominde@gmail.com>
homepage:
http://trac-plugins.gajim.org/wiki/SetLocalitionPlugin
This diff is collapsed.
Click to expand it.
set_location/set_location.py
+
23
−
9
View file @
eccb3b88
...
...
@@ -10,6 +10,7 @@ from plugins.gui import GajimPluginConfigDialog
from
plugins
import
GajimPlugin
from
plugins.helpers
import
log
,
log_calls
from
common
import
gajim
from
common
import
ged
import
gtkgui_helpers
from
dialogs
import
InputDialog
,
WarningDialog
...
...
@@ -43,6 +44,22 @@ class SetLocationPlugin(GajimPlugin):
@log_calls
(
'
SetLocationPlugin
'
)
def
activate
(
self
):
gajim
.
ged
.
register_event_handler
(
'
signed-in
'
,
ged
.
POSTGUI
,
self
.
on_signed_in
)
self
.
send_locations
()
@log_calls
(
'
SetLocationPlugin
'
)
def
deactivate
(
self
):
self
.
_data
=
{}
for
acct
in
gajim
.
connections
:
gajim
.
connections
[
acct
].
send_location
(
self
.
_data
)
gajim
.
ged
.
remove_event_handler
(
'
signed-in
'
,
ged
.
POSTGUI
,
self
.
on_signed_in
)
def
on_signed_in
(
self
,
network_event
):
self
.
send_locations
(
network_event
.
conn
.
name
)
def
send_locations
(
self
,
acct
=
False
):
self
.
_data
=
{}
timestamp
=
time
.
time
()
timestamp
=
datetime
.
utcfromtimestamp
(
timestamp
)
...
...
@@ -50,16 +67,13 @@ class SetLocationPlugin(GajimPlugin):
self
.
_data
[
'
timestamp
'
]
=
timestamp
for
name
in
self
.
config_default_values
:
self
.
_data
[
name
]
=
self
.
config
[
name
]
for
acct
in
gajim
.
connections
:
if
gajim
.
connections
[
acct
].
connected
==
0
:
gajim
.
connections
[
acct
].
to_be_sent_location
=
self
.
_data
else
:
gajim
.
connections
[
acct
].
send_location
(
self
.
_data
)
@log_calls
(
'
SetLocationPlugin
'
)
def
deactivate
(
self
):
self
.
_data
=
{}
for
acct
in
gajim
.
connections
:
if
not
acct
:
#set geo for all accounts
for
acct
in
gajim
.
connections
:
if
gajim
.
config
.
get_per
(
'
accounts
'
,
acct
,
'
publish_location
'
):
gajim
.
connections
[
acct
].
send_location
(
self
.
_data
)
elif
gajim
.
config
.
get_per
(
'
accounts
'
,
acct
,
'
publish_location
'
):
gajim
.
connections
[
acct
].
send_location
(
self
.
_data
)
...
...
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