nekohayo / specto

Automatically exported from code.google.com/p/specto
0 stars 0 forks source link

Use of NetworkManager for checking network connection #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Network Manager is cool, useful for laptop users, has a DBUS API, and is
working to be included in Gnome sometime soon :).

Here is an initial, minimal patch to augment the current "ping google.com"
type network-detection.  My overall plan would be to strip out the current
network-detection code, add it as a class in connectionmanager.py, and
select it an NM at runtime depending on whether NM is running or not.

Finally, you could use the NM code to listen for connection events, and
cache them, so that instead of having a single network check at startup,
you instead have a (quick, cached) check each and every time you try a
watch.  That's what I'll be working towards

Original issue reported on code.google.com by chalsero...@gmail.com on 22 Nov 2006 at 3:40

Attachments:

GoogleCodeExporter commented 9 years ago
Initial test:

  File "/home/jeff/trunks/specto/src/specto/main.py", line 42, in ?
    from specto.net import connectionmanager as conmgr
ImportError: No module named net

;) the thing is we need to agree on the file/folder structure in issue 20 first 
I
guess... I'll send a short message to the google group.

Original comment by nekoh...@gmail.com on 22 Nov 2006 at 10:05

GoogleCodeExporter commented 9 years ago
Ah, OK.  I see why that happens: applying the patch doesn't create the two empty
__init__.py files the module needs.  Stupid svn diff :(

You should be able to get it to work by simply running (from the src directory)
"touch specto/net/__init__.py".

Additionally, if you want to run the unittests, you'll also want to touch
src/specto/net/test/__init__.py.  I use twisted-trial to run the unittests, but 
I'll
add a __main__ in there (so unittests can be run without trial) before I commit 
this.

Original comment by chalsero...@gmail.com on 23 Nov 2006 at 12:24

GoogleCodeExporter commented 9 years ago

Original comment by chalsero...@gmail.com on 2 Feb 2007 at 5:11

GoogleCodeExporter commented 9 years ago
Someone should write which modules currently work with NM, and which do not. A 
status
report, kind of, so we know what is left to be hacked on.

Original comment by nekoh...@gmail.com on 2 Feb 2007 at 5:33

GoogleCodeExporter commented 9 years ago
Seems like it's mostly done. Some small issue I am jotting down here that will 
have
to be fixed after the 0.2 release when we do some cleanup:

Wout Clymans: sometimes the refresh icons does not change back to the original 
image
Kiddo: well, that's as long as you are disconnected and when you reconnect they
complete the refresh and go back to normal, no? at least that's how I saw it 
working
on my side 
Wout Clymans: yes on my side too, but i would like to see an other icon when 
specto
is disconnected, instead of the refresh icon
Kiddo: I wonder if this can be done now or if this depends on the big cleanup 
after
0.2; a balloon would be nice too
Wout Clymans: maybe you could add another preference like "notify me when i 
lost my
connection"
Kiddo: hmm tough choice. Either we:
- have the user depend entirely on the fact that he manually adds a network 
watch
- notify no matter what
- indicate with some kind of "firefox blocked a popup"-like banner in the 
notifier
window that "the network seems to be down, watches will not update until then"

But I would not like another preference for such a trivial thing, it should 
behave
like the rest of the watches, kind of... not sure what I say makes sense. We 
should
find a way to disable the "refresh" icon changing when there's no network, but 
that's
because our code is so messy that I think it needs to be postponed. However, 
changing
the icons to something else would just add confusion, every icon would be the 
same!
While there is *technically* no real error
Wout Clymans: that's true
Wout Clymans: maybe just leave it like it is for now

Original comment by nekoh...@gmail.com on 6 Feb 2007 at 6:38

GoogleCodeExporter commented 9 years ago

Original comment by chalsero...@gmail.com on 27 Mar 2007 at 3:01

GoogleCodeExporter commented 9 years ago
I *think* this feature is complete, reopen if need be.

Original comment by nekoh...@gmail.com on 1 Jul 2007 at 2:29

GoogleCodeExporter commented 9 years ago

Original comment by nekoh...@gmail.com on 18 Mar 2008 at 1:54