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

« back to all changes in this revision

Viewing changes to mnemosyne/mnemosyne/libmnemosyne/utils.py

  • Committer: Peter Bienstman
  • Date: 2012-08-31 18:44:34 UTC
  • Revision ID: peter.bienstman@ugent.be-20120831184434-k7j6biui6c85a4bk
-fix case-related bug
-don't ask for exit confirmation in 'edit cards' if nothing has changed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
import sys
10
10
import random
11
11
import shutil
 
12
import tempfile
12
13
import traceback
13
14
 
14
15
class MnemosyneError(Exception):
102
103
        os.rmdir(path)
103
104
 
104
105
 
 
106
def is_filesystem_case_insensitive():
 
107
    # By default mkstemp() creates a file with a name that begins with
 
108
    # 'tmp' (lowercase)
 
109
    tmphandle, tmppath = tempfile.mkstemp()
 
110
    return os.path.exists(tmppath.upper())
 
111
 
 
112
 
105
113
def numeric_string_cmp(s1, s2):
106
114
 
107
115
    """Compare two strings using numeric ordering