Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/jarabe/model/adhoc.py
Commit message (Collapse)AuthorAgeFilesLines
* Use uuid.uuid4 to generate random connection UUIDsDaniel Drake2012-10-101-2/+2
| | | | | | | | | | | | | Recent versions of NetworkManager have gotten stricter when checking UUIDs. A UUID must be 32 hex characters plus 4 dashes. Sugar's unique_id() doesn't satisify this. Switch to using uuid.uuid4 from the uuid python module to generate UUIDs. [1] http://docs.python.org/library/uuid.html Signed-off-by: Daniel Drake <dsd@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
* Run sugar-convert.sh for automatic conversion from sugar.* to sugar3.* importsSimon Schampijer2012-09-071-1/+1
| | | | | | | | | | | | | | Run sugar-convert.sh [1] for automatic conversion from sugar.* imports to sugar3.* imports. This is only on a best-effort basis; the code will be in a broken state after this patch and need to be fixed manually. The purpose of committing the intermediate, non-working output is to make it reproducible. It's impractical to manually review the changes. [1] http://dev.laptop.org/~manuq/sugar-convert.sh Signed-off-by: Simon Schampijer <simon@laptop.org> Acked-by: Manuel Quiñones <manuq@laptop.org>
* Run pygi-convert.sh for automatic conversion from GTK+ 2 to GTK+ 3Simon Schampijer2012-09-071-9/+9
| | | | | | | | | | | | | | | | | | Run pygi-convert.sh for automatic conversion from GTK+ 2 to GTK+ 3 and pygobject+gobject-introspection. This is only on a best-effort basis; the code will be in a broken state after this patch and need to be fixed manually. The purpose of committing the intermediate, non-working output is to make it reproducible. It's impractical to manually review the changes. The exact version used was 2d8f48f4ff56bb75985136452b50b75895258608 from the main pygobject repository [1]. [1] git://git.gnome.org/pygobject Signed-off-by: Simon Schampijer <simon@laptop.org> Acked-by: Manuel Quiñones <manuq@laptop.org>
* Don't treat SSID as UTF-8 character sequence (fixes SL#2023)Sascha Silbe2012-04-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IEEE 802.11 [2] defines the SSID as a sequence of octets (i.e. bytes), but Sugar treated it as UTF-8 character data. While in most cases the SSID is actually some human-readable string, there's neither a guarantee for that nor does any (de-facto or de-jure) standard specify the encoding to use. As a result, we'll encounter SSIDs in a large variety of encodings and will also need to cope with arbitrary byte strings. Any assumption of a single (or in fact any) character encoding is incorrect. The D-Bus API of NetworkManager 0.9 [3] passes SSIDs as uninterpreted byte strings (D-Bus signature "ay"). Before SSIDs can be displayed on screen, some kind of interpretation must happen. NetworkManager has a rather elaborate heuristic that takes the user locale into account. In the future (i.e. when the NetworkManager client code in Sugar has been ported to gobject-introspection) we may use nm_utils_ssid_to_utf8() [4], but for now we're doing the following to allow the user to use non-UTF-8 APs at all: 1. If the SSID is a valid character string consisting only of printable characters in one of the following encodings (tried in the given order), decode it accordingly: UTF-8, ISO-8859-1, Windows-1251. 2. Return a hex dump of the SSID. The first rule should cover the majority of current Sugar users and hopefully all AP vendors will switch to UTF-8 eventually. In the meantime, the second rule allows users to distinguish between several APs with SSIDs in unknown encodings (or even using arbitrary byte sequences that don't _have_ a character representation). Tested: - filtering on ASCII and non-ASCII parts of the name of and connecting to: - an unsecured AP with a UTF-8 SSID ("äöü߀sugartest", HostAP) - an unsecured AP with an ISO-8859-1 SSID ("äöüßsugartest", HostAP) - an unsecured AP with a non-character SSID (0d:06:f0:0d, HostAP) - a WEP-secured AP with a UTF-8 name ("äöü߀sugartest2", HostAP) - a WEP-secured AP with an ISO-8859-1 name ("äöüßsugartest2", HostAP) - a WEP-secured AP with a non-character SSID (0d:06:f0:0d, HostAP) - a WPA-secured AP with an ASCII name (COTS AP) In each case the name was displayed correctly in a) the palette of the AP icon in the Neighbourhood, b) the palette of the wireless network Frame device and c) the title of the WLAN credentials (WEP/WPA passphrase) dialog (for the WEP/WPA cases). [1] https://bugs.sugarlabs.org/ticket/2023 [2] http://standards.ieee.org/getieee802/download/802.11-2007.pdf [3] http://projects.gnome.org/NetworkManager/developers/api/09/spec.html [4] http://projects.gnome.org/NetworkManager/developers/libnm-util/09/libnm-util-nm-utils.html#nm-utils-ssid-to-utf8 Signed-off-by: Sascha Silbe <silbe@activitycentral.com> Reviewed-by: Daniel Drake <dsd@laptop.org>
* Simple NetworkManager-0.9 portDaniel Drake2011-11-161-61/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adapt sugar to NetworkManager-0.9 API changes. The major change here is the removal of the user-level connections mechanism; instead of storing connection information in Sugar, NetworkManager now Manages our Networks for us. However, some level of interfacing/monitoring NM is now needed, implemented with the Connections and Connection classes in jarabe.model.network. If found, connections in sugar's connections.cfg are automatically migrated, and then connections.cfg is deleted. Similarly, if modem connection details are found in gconf, they are migrated into NM and then the gconf keys are unset. The existing network code is far from perfect and actually quite messy. In this port I've tried not to make fundamental changes to improve this, in order to keep task complexity down and aid review. In the medium term I do plan to improve this code, by moving it to use gobject-introspection on libnm, and rewriting/restructuring at the same time. By letting libnm do most of the work for us, this layer can be greatly simplified. However, libnm and gobject-introspection improvements are needed first, which I will continue to work on. Modem PUK configuration has been removed as NetworkManager no longer has configuration for this. It hasn't been used (and was marked deprecated) throughout the NM-0.8 release series.
* Sugar Ad-hoc network: reconnect after suspend SL #2187Simon Schampijer2011-03-021-13/+7
| | | | | | | | | | | | | | | | | | Setting the 'autoconnect' property for the connection will let NM do the reconnection when the device is up. If the Sugar Ad-hoc network is around it will automatically connect to it. The connection is not stored after logging out of Sugar. The autoconnect functionality inside Sugar is still needed for the cases when we log into Sugar, after a timeout we will connect to an exisiting Ad-hoc network or will default to the Sugar Ad-hoc network on channel 1. I increased the timeout to 60 seconds because during testing I found to get more reliable results like that. Signed-off-by: Simon Schampijer <simon@laptop.org> Acked-By: Sascha Silbe <silbe@activitycentral.com>
* Make sure to listen on the new device after suspend OLPC #10672Simon Schampijer2011-03-021-0/+1
| | | | | Signed-off-by: Simon Schampijer <simon@laptop.org> Acked-By: Sascha Silbe <silbe@activitycentral.com>
* use dbus.PROPERTIES_IFACE instead of literal valueJames Cameron2011-02-051-1/+1
| | | | | | | [split out from larger "fix network disconnect and discard history" patch; fixed up all remaining occurences as well] Signed-Off-By: Sascha Silbe <silbe@activitycentral.com> Reviewed-By: Sascha Silbe <silbe@activitycentral.com>
* style cleanup: prefer ' for stringsSascha Silbe2010-11-241-2/+2
| | | | | | | | | Tomeu prefers ' for strings, so let's use it wherever we don't have a good reason to use ". Reviewed-by: James Cameron <quozl@laptop.org> Reviewed-by: Simon Schampijer <simon@laptop.org> CC: Aleksey Lim <alsroot@member.fsf.org>
* PEP8 cleanup: fix spaces around operators and parenthesesSascha Silbe2010-11-241-1/+1
| | | | | | Reviewed-by: James Cameron <quozl@laptop.org> Reviewed-by: Simon Schampijer <simon@laptop.org> CC: Aleksey Lim <alsroot@member.fsf.org>
* pep8 cleanup: fix number of blank linesSascha Silbe2010-11-241-0/+1
| | | | | | Reviewed-by: James Cameron <quozl@laptop.org> Reviewed-by: Simon Schampijer <simon@laptop.org> CC: Aleksey Lim <alsroot@member.fsf.org>
* style cleanup: move globals before class and method definitionsSascha Silbe2010-11-241-1/+2
| | | | | | | | | | | | | This only touches the globals that were flagged by pep8 due to white space issues or contain "instance" in their name (singleton pattern). I've also left the sunflower layout variables alone. AFAICT this layout is currently unused and should be removed instead (or factored out like the snow flake layout and reenabled). Reviewed-by: James Cameron <quozl@laptop.org> Reviewed-by: Simon Schampijer <simon@laptop.org> CC: Aleksey Lim <alsroot@member.fsf.org>
* Don't try to autoconnect to a Sugar ad-hoc network if the wifi deviceTomeu Vizoso2010-08-161-12/+5
| | | | isn't in the DISCONNECTED state.
* Add default Ad-hoc networks #1610Simon Schampijer2010-08-131-0/+299
This patch adds three default Ad-hoc networks, for channel 1, 6 and 11. They are represented with designated icons in the neighborhood view. This will mimic the mesh behavior on devices where mesh hardware is not available and make the "under a tree"-scenario possible in those cases. If Sugar sees no "known" network when it starts, it does autoconnect to an Ad-hoc network. http://wiki.sugarlabs.org/go/Features/Sugar_Adhoc_Networks