~kevang/mnemosyne-proj/grade-shortcuts-improvements

« back to all changes in this revision

Viewing changes to mnemosyne/mnemosyne/libmnemosyne/filters/expand_paths.py

  • Committer: Peter.Bienstman at UGent
  • Date: 2014-11-20 07:06:10 UTC
  • Revision ID: peter.bienstman@ugent.be-20141120070610-nhjjtat5bmt770yo
Activate cards work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
            i = text.lower().find(tag, end + 1)
41
41
        # Replace code word 'db_media:///' by the absolute path for use e.g.
42
42
        # in javascript.
43
 
        text = text.replace("db_media:///", 
44
 
            self.database().media_dir().replace("\\", "/") + "/")
 
43
        if "db_media:///" in text:
 
44
            text = text.replace("db_media:///", 
 
45
                self.database().media_dir().replace("\\", "/") + "/")
 
46
            if not text.startswith("/"):
 
47
                text = "/" + text
45
48
        return text