manuskript/manuskript
Curtis Gedak 60cc6c59aa Skip loading directory and file names that begin with a period
See issue #281.

When loading a project that has the setting **Save to one single
file** disabled, Manuskript tries to read all directories and files
under the project directory.

Manuskript expects all files to contain valid unicode characters.

However if a file containing non-unicode characters is read then
Manuskript will crash.

The error message displayed on the console is similar to the
following:

----- begin snippet -----
Traceback (most recent call last):
  File "/home/gedakc/workspace/manuskript.olivierkes/bin/../manuskript/ui/welcome.py", line 134, in loadRecentFile
    self.mw.loadProject(act.data())
  File "/home/gedakc/workspace/manuskript.olivierkes/bin/../manuskript/mainWindow.py", line 566, in loadProject
    self.loadDatas(project)
  File "/home/gedakc/workspace/manuskript.olivierkes/bin/../manuskript/mainWindow.py", line 793, in loadDatas
    errors = loadSave.loadProject(project)
  File "/home/gedakc/workspace/manuskript.olivierkes/bin/../manuskript/loadSave.py", line 66, in loadProject
    v1.loadProject(project, zip=isZip)
  File "/home/gedakc/workspace/manuskript.olivierkes/bin/../manuskript/load_save/version_1.py", line 657, in loadProject
    files[os.path.join(p, f)] = fo.read()
  File "/usr/lib/python3.5/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 3131: invalid start byte
----- end snippet -----

There are at least two known situations in which files with
non-unicode characters can arise:

A. The project is on Mac OS X and the operating system automatically
   creates a .DS_Store file.

B. The project is under git version control and contains a .git
   subdirectory.

This enhancement prevents the Manuskript crash on project load by
ignoring all directory and file names that start with a period.
2018-01-14 11:51:50 -07:00
..
converters Improves the Mind Map importer #208 2017-11-13 22:55:33 +01:00
exporter Adds new markdown highlighter and many little tweaks 2017-11-27 21:35:32 +01:00
functions Adds: clickable links, and display images as tooltips (#22, #215) 2017-12-14 14:55:14 +01:00
importer Changes every Enum to IntEnum 2017-11-15 21:05:48 +01:00
load_save Skip loading directory and file names that begin with a period 2018-01-14 11:51:50 -07:00
models Adds: references tests, corrects bugs 2017-11-20 15:42:30 +01:00
tests Adds: simple ui tests for exporter and importer widgets 2017-11-22 11:27:21 +01:00
ui Adds "Sentence mode" to Focus mode. #259 2017-12-15 20:56:40 +01:00
__init__.py Renaming source folder 2016-02-06 08:38:33 +01:00
enums.py Checkpoint in refactoring outlineItem 2017-11-17 12:16:39 +01:00
loadSave.py Fixes: Crash when permissions don't allow saving #138 2017-10-14 12:17:03 +02:00
main.py Adds #223: command line parameter to open project 2017-11-30 17:47:23 +01:00
mainWindow.py Another take on status bar (#262) 2017-12-08 10:20:33 +01:00
settings.py Adds "Sentence mode" to Focus mode. #259 2017-12-15 20:56:40 +01:00
settingsWindow.py Adds "Sentence mode" to Focus mode. #259 2017-12-15 20:56:40 +01:00
version.py Updates version number and deb build script. 2017-11-22 22:26:28 +01:00