Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAjay Garg <ajay@activitycentral.com>2013-02-16 05:31:03 (GMT)
committer Ajay Garg <ajay@activitycentral.com>2013-02-16 06:45:02 (GMT)
commitbeb6ec9c2ec07e8a2ec6380961a7a490871cfba7 (patch)
treeac5e5d8892650a111c0e1adccde588bd3a5e0d8d /src
parentf874d7f74d1b0f6dd6ae3e027ee373ea645a9128 (diff)
sdxo#1143: "Hidden-SSIDs" feature.
Note that following are the UI changes from the earlier implementation: * No explicit "Save" button. * Instead, the "tick" toolbar button will do this job (taking into proper considerations for the "Cancel Changes","Later" and "Restart" scenarios). This keeps it consistent with the rest of the sections in the "Network" panel. * No explicit "Please reboot your XO to effect changes" message. * Instead the top-toolbar gives this message when the "tick" button is clicked. This keeps it consistent with the rest of the sections in the "Network" panel. Following are the backend changes from the earlier implementation: * The "iwconfig" network-scanning will now be done at "sugar" (re)start, instead of "system"" (re)start. This helps solve the following issues : * No startup terminal-text problems now. * No dependency on any external package ("z-sugar-hidden-network"). * The "restart" notification in "My Settings" -> "Network", is now also consistent, as the restart here refers to "sugar" restart. Thus, "sugar" restart is what is now all that is needed to make the hidden wireless networks appear in the Neighborhood-View. The only caveat: "sudo" must be available for the "olpc" user (without needing a password). Signed-off-by: Ajay Garg <ajay@activitycentral.com>
Diffstat (limited to 'src')
-rw-r--r--src/jarabe/journal/misc.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/jarabe/journal/misc.py b/src/jarabe/journal/misc.py
index f627c1b..7831051 100644
--- a/src/jarabe/journal/misc.py
+++ b/src/jarabe/journal/misc.py
@@ -41,6 +41,7 @@ from jarabe.journal import model
from jarabe.journal import journalwindow
_NOT_AVAILABLE = _('Not available')
+HIDDEN_SSID_FILE = os.path.expanduser('~/.sugar/default/hidden_ssid')
def _get_icon_for_mime(mime_type):
generic_types = mime.get_all_generic_types()
@@ -358,3 +359,18 @@ def get_backup_identifier():
if serial_number is _NOT_AVAILABLE:
serial_number = get_nick()
return serial_number
+
+
+def get_hidden_ssids():
+ ssids = []
+
+ # If the file does not exist, return.
+ if not os.path.exists(HIDDEN_SSID_FILE):
+ return ssids
+
+ f = open(HIDDEN_SSID_FILE, 'r')
+ for ssid in f.readlines():
+ ssids.append(ssid.rstrip('\n'))
+ f.close()
+
+ return ssids