From 6f44462455d8abad918c420636f4adcc7f64138c Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sat, 08 Jun 2013 13:18:45 +0000 Subject: 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 --- 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'] -- cgit v0.9.1