From db0d7f45b2e764dfec369051adb7c192ee69fc62 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 29 Mar 2011 22:45:53 +0900 Subject: [PATCH] update readme, add shortcut() for later --- README | 7 +------ aqt/facteditor.py | 2 ++ aqt/utils.py | 5 +++++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README b/README index 2f2b7a8c5..f27506087 100644 --- a/README +++ b/README @@ -4,16 +4,11 @@ Anki Prerequisites for Linux/FreeBSD/etc: - Python 2.4+ -- Python-Qt/PyQt 4.4+ +- Python-Qt/PyQt 4.5+ - SimpleJSON 1.7.3+ - PySQLite 1.3+ or Python2.5 - Beautiful Soup -For graph generation: - -- python-numpy (numpy) -- python-matplotlib (matplotlib) - For audio playing support: - mplayer diff --git a/aqt/facteditor.py b/aqt/facteditor.py index 8f34e02b0..2dc8c3caa 100644 --- a/aqt/facteditor.py +++ b/aqt/facteditor.py @@ -15,6 +15,8 @@ from aqt.utils import mungeQA, saveGeom, restoreGeom from anki.hooks import addHook, removeHook, runHook, runFilter from sqlalchemy.exceptions import InvalidRequestError +# fixme: use shortcut() for mac shortcuts + clozeColour = "#0000ff" if sys.platform.startswith("win32"): diff --git a/aqt/utils.py b/aqt/utils.py index 5b275b023..a21aec569 100644 --- a/aqt/utils.py +++ b/aqt/utils.py @@ -289,3 +289,8 @@ def openFolder(path): call(["explorer", path], wait=False) else: QDesktopServices.openUrl(QUrl("file://" + path)) + +def shortcut(key): + if sys.platform == "darwin": + return re.sub("(?i)ctrl", "Command", key) + return key