Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2013-06-08 13:18:45 (GMT)
committer Ruben Rodriguez <ruben@activitycentral.com>2013-06-11 00:57:34 (GMT)
commit6f44462455d8abad918c420636f4adcc7f64138c (patch)
tree32f0d579c7878698d7239c5bcf594e601e884706
parentb631180dd75a142f9c3f85bb8d9efe38ee797742 (diff)
Set HIDDEN attribute on .Sugar-Metadata directory
According to the OLPC AU dpeloyment [1], 50% of the support calls they get from teachers are due to a confusion caused by looking in the .Sugar-Metadata directory for files from Windows. "On Windows, the directory is not hidden, and people are going into it expecting their files to be in there. What's even more confusing is that the filenames they are looking for are indeed inside, but those are metadata and not the actual files." This patch uses a new Sugar extension, sugar-fatattr, to set the HIDDEN attribute on the .Sugar-Metadata directory.[2] [1] http://sugardextrose.org/issues/1367 [2] sugarlabs/sugar-toolkit-gtk3#33
-rw-r--r--src/jarabe/journal/model.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
index 727e4ff..f8b39a4 100644
--- a/src/jarabe/journal/model.py
+++ b/src/jarabe/journal/model.py
@@ -34,6 +34,8 @@ import dbus
from gi.repository import Gio
from gi.repository import GConf
+from gi.repository import SugarExt
+
from sugar3 import dispatch
from sugar3 import mime
from sugar3 import util
@@ -1067,6 +1069,12 @@ def _write_metadata_and_preview_files_and_return_file_paths(metadata,
if not os.path.exists(metadata_dir_path):
os.mkdir(metadata_dir_path)
+ # Set the HIDDEN attrib even when the metadata directory already
+ # exists for backward compatibility.
+ if not SugarExt.fat_set_hidden_attrib(metadata_dir_path):
+ logging.error('Could not set hidden attribute on %s' %
+ (metadata_dir_path))
+
preview = None
if 'preview' in metadata_copy:
preview = metadata_copy['preview']