diff -Nru mnemosyne-2.4/.appveyor.yml mnemosyne-2.6+ds/.appveyor.yml --- mnemosyne-2.4/.appveyor.yml 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/.appveyor.yml 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,46 @@ +# See also: https://packaging.python.org/guides/supporting-windows-using-appveyor/#setting-up + +image: +- Visual Studio 2015 + +environment: + matrix: + - PYTHON: "C:\\Python36-x64" + PATH: "%PATH%;C:\\projects\\mnemosyne\\miktex\\texmfs\\install\\miktex\\bin" + APPVEYOR_SAVE_CACHE_ON_ERROR: "true" + +version: '{branch}-{build}' + +platform: x64 + +clone_depth: 20 + +build: off + +cache: + - C:\cache + +# Enable rdp connections on init or finish +#init: +# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) +#on_finish: +# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + +install: + - ps: "If (!(Test-Path C:\\cache)){mkdir C:\\cache}" + - ps: "If (!(Test-Path C:\\cache\\pip)){mkdir C:\\cache\\pip}" + - ps: "If (!(Test-Path C:\\cache\\miktex-portable.exe)){wget http://mirrors.ctan.org/systems/win32/miktex/setup/miktex-portable.exe -OutFile C:\\cache\\miktex-portable.exe}" + - cmd: "7z x C:\\cache\\miktex-portable.exe * -aot -omiktex" + - cmd: "dir C:\\cache" + # Not sure why we need it, but dvipng triggers the miktex package manager + # and wants to install zhmetrics + # If we ever need a local miktex repository: # https://bruceyf.wordpress.com/2008/05/07/miktexs-secret-local-package-repository/ + - cmd: "mpm --install=zhmetrics" + - cmd: "latex -interaction=nonstopmode -version" + - cmd: "%PYTHON%\\python.exe -m pip install --cache-dir C:\\cache\\pip -r requirements.txt" + - ps: "mkdir -p mo\\de\\LC_MESSAGES" + - cmd: "%PYTHON%\\python.exe po\\msgfmt.py -o mo\\de\\LC_MESSAGES\\mnemosyne.mo po\\de.po" + +test_script: + # Use -v to list test names + - cmd: "%PYTHON%\\python.exe -m nose tests" diff -Nru mnemosyne-2.4/.bzrignore mnemosyne-2.6+ds/.bzrignore --- mnemosyne-2.4/.bzrignore 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/.bzrignore 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,190 @@ +# Ignore files and directories created by the following commands: +# +# `make` +# `make setup` +# `make test` +# `make coverage` + +.coverage +dot_sync_A/ +dot_sync_B/ +dot_sync_C/ +dot_sync_client/ +dot_sync_server/ +dot_test/ +htmlcov/ +mnemosyne/Mnemosyne.egg-info/ +mnemosyne/bin/ +mnemosyne/dot_mnemosyne2/ +mnemosyne/include/ +mnemosyne/lib/ +mnemosyne/local/ +mnemosyne/mnemosyne/**/*.pyc +mnemosyne/mnemosyne/pyqt_ui/mnemosyne_rc.py +mnemosyne/mnemosyne/pyqt_ui/tmp +mnemosyne/mnemosyne/pyqt_ui/ui_* +mnemosyne/mo/ +mnemosyne/openSM2sync/**/*.pyc +mnemosyne/tests/**/*.pyc +mnemosyne/tests/files/basedir_to_merge/to_merge.db-journal +outside.db +outside.db-journal + + +# Created by https://www.gitignore.io/api/android,emacs,intellij,vim + +### Android ### +# Built application files +*.apk +*.ap_ + +# Files for the ART/Dalvik VM +*.dex + +# Java class files +*.class + +# Generated files +bin/ +gen/ +out/ + +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) +local.properties + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files +*.log + +# Android Studio Navigation editor temp files +.navigation/ + +# Android Studio captures folder +captures/ + +# Intellij +*.iml +.idea/workspace.xml + +# Keystore files +*.jks + +### Android Patch ### +gen-external-apklibs + + +### Emacs ### +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/workspace.xml +.idea/tasks.xml +.idea/dictionaries +.idea/vcs.xml +.idea/jsLibraryMappings.xml + +# Sensitive or high-churn files: +.idea/dataSources.ids +.idea/dataSources.xml +.idea/dataSources.local.xml +.idea/sqlDataSources.xml +.idea/dynamic.xml +.idea/uiDesigner.xml + +# Gradle: +.idea/gradle.xml +.idea/libraries + +# Mongo Explorer plugin: +.idea/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml + + +### Vim ### +# swap +[._]*.s[a-w][a-z] +[._]s[a-w][a-z] +# session +Session.vim +# temporary +.netrwhist +*~ +# auto-generated tag files +tags + diff -Nru mnemosyne-2.4/ChangeLog mnemosyne-2.6+ds/ChangeLog --- mnemosyne-2.4/ChangeLog 2016-12-01 12:34:46.000000000 +0000 +++ mnemosyne-2.6+ds/ChangeLog 2018-02-07 21:03:52.000000000 +0000 @@ -1,48 +1,145 @@ +(Note for Windows 7 users: if you run into problems related to +missing api-ms-win-crt-runtime-l1-1-0-dll make sure your machine +has the latest Windows patches and/or download this: + +https://www.microsoft.com/en-us/download/details.aspx?id=48145 + +This might also help with other hard crashes. + +Additionally, if you see a black screen, start Mnemosyne with the +--qt-opengl=desktop command line argument.) + + +Mnemosyne 2.6 : 2017-12-11 + +- Import of Anki databases (both *.anki2 and *.apgk) as well as + possibility to edit these M-sided card types (though not yet in a way + that would change the number of sister cards). +- Fix display of question in the card browser in case you configured + Mnemosyne to show question and answer in the same window. +- Fix bugs with increase of non-latin fonts (reported by JDD annd Scott + Youngman). +- Fix cornercase bug in RTL handler (reported by Fonzo99). +- Upgrade to latest version of libraries (PyQt, Python, Matplotlib). +- Improve keyboard shortcuts (reported by Scott Youngman). +- Fixes to the behaviour of the Edit dialog of the Card Browser (reported by + Scott Youngman). +- Also save window size when exiting window by pressing escape (reported by + Scott Youngman). +- Fix display of map cards when showing Q and A in the same box (reported by + Scott Youngman). +- Disallow renaming a single tag to multiple tags in the tag tree widget. + (reported by abacus). +- In case you get crashes in the browser when trying to display only untagged + cards, you can now run 'File - Compact - Defragment database' to fix this + (reported by abacus). +- Fix crash in headless server. +- Fix crashes when running separate scripts (patch by Julian Mehne). + + +Mnemosyne 2.5 : 2017-06-26 + +-New feature: Study Modes, allowing you to e.g. only study unlearned + cards. The Cramming scheduler is also migrated to this functionality. +-Added option to "Configure Mnemosyne" to affect how cards are displayed, + in two boxes with fixed size, two boxes with adaptive size, or a single + box top aligned. +-Tweaks to tag combobox (Emilian Mihalache). +-Updated to PyQt 5.8.2. +-Scaling for high-definition displays now enabled by default. + (start with --disable-high-dpi-scaling if you prefer the previous behaviour). +-Fix crash when deleting unused media files (reported by gorgar). +-Small performance optimisations in the database. +-Fix crash in configuration widget under Linux with some fonts (e.g. Google + Noto fonts) (fix by m4984). +-Fix crash when selecting negative tags (reported by 2a216566f1). +-Fix keyboard shortcuts not working sometimes (reported by Angelika Blaschka). +-Improved compatibility with different Qt versions under Linux + (reported by Huang Shuhan). +-When setting the fonts for all the card types at once, the dialog will now + correctly remember the setting (reported by 2a216566f1). +-Added warning if OpenGL libraries are missing under Linux + (Andy Rayner). +-Try and work around cases where the progress bar after sync wouldn't + close under Linux (reported by Kienan). +-Fix crash when running with the --debug option (reported by themusicgod1). + + +Mnemosyne 2.4.1 : 2017-01-30 + +-Updated to PyQt 5.7.1. +-Fix broken cramming plugin (reported by stevengeorg). +-Fix encoding problems with import and export (reported by register2, + MarcoP, abacus). +-Improve subdirectory handling (reported by abacus, duncantaylor). +-Make configuration storing more thread-safe. +-Warn if an old plugin needs to be updated. +-Location and size of 'Add cards' window is saved again (reported by + David Schuler). +-Fix removing tags through card browser (reported by bvauquelin). +-Fix loss of keyboard focus when switching back to the main window + (reported by Jan Egil Hagen and Dan Schmidt). +-Fixed crash in card browser when working with forbidden tags + (reported by Benjamin Brueck). +-Fix autoscaling of Q and A sometimes not working under Linux. +-Fix error related missing idna encoding when starting server + (reported by Andrea Giordano). +-Fix error related to upgrading from very old databases (reported by + David Schuler) +-Fix for latest version of cherrypy unbundling its WSGIserver + (reported by Aramís Concepción Durán). +-New command line option "--qt-opengl" which can be set to either + 'desktop', 'angle' or 'software', which you can play around with if + you have display issues. + + Mnemosyne 2.4 : 2016-12-05 -Upgraded all code to Python3 and PyQt5, so that Mnemosyne no longer depends on libraries which are gradually becoming unsupported. -The move to PyQt5 enabled to show progress bars with percentages for certain long operations like initial sync. --Improved startup speed. +-Improved startup speed. -New command line option "--high-dpi-scaling" to enable scaling for displays with high DPI values. Not enabled by default because it can cause some issues with multiple connected displays. -Tag combobox now expands to give suggestions for tags also when using more than one tag (patch by Emilian Mihalache) + Android 20160502: -Upgraded backend to Mnemosyne 2.3.6, meaning that logs older than 1 year - are now automatically archived in a separate file, which is not backed + are now automatically archived in a separate file, which is not backed up all the time, speeding up the sync process and taking less space. --Switched to Material design, also making it easier to access the menu on +-Switched to Material design, also making it easier to access the menu on some devices which had problems with this before. -Implemented full screen immersive mode for Android KitKat and higher. -Buttons are now in the middle of the screen to better facilitate ergonomic one-handed operation. + Mnemosyne 2.3.6 : 2016-05-02 -Logs older than 1 year are now automatically archived in a separate file, which is not backed up all the time, speeding up e.g. the sync process. --The card browser now supports more html formatting, e.g. ruby tags. --URLs in cards in the review widget now open in an external browser, rather +-The card browser now supports more html formatting, e.g. ruby tags. +-URLs in cards in the review widget now open in an external browser, rather than the internal Qt webview which does not have back buttons e.g.. -Only changing a card type in the 'Edit current card' dialog now works again (reported by Henrik). -Failed cards no longer are listed as overdue in the card browser (requested by Samuel Innes) --Fixed bugs related to Unicode filenames under Android (reported by Jan - Egil Hagen). --When adding a tag with the same name both on client and server before +-Fixed bugs related to Unicode filenames under Android (reported by Jan + Egil Hagen). +-When adding a tag with the same name both on client and server before syncing, rename one of these tags. Users still need to unify and activate - the tags though (reported by Jan Egil Hagen). + the tags though (reported by Jan Egil Hagen). -Added a --version command line argument to display the version (requested by Matthew Exon). -Also accept files with *.tsv extention when importing tab-separated data - (requested by Ojas A). --Don't leave the 'Client Logging in...'' dialog on the sync server open in + (requested by Ojas A). +-Don't leave the 'Client Logging in...'' dialog on the sync server open in case the client provides a wrong password (reported by Eric). -Fixed formatting when using 'db_media:///' in cards with javascript ( reported by Pete Kovalenko). @@ -80,23 +177,23 @@ the changes (reported by vmixeen). -Fixed issue where creating clones of card types would sometimes clone the wrong card type. --Prefill tag behaviour plugin: don't update the last used tags when editing a +-Prefill tag behaviour plugin: don't update the last used tags when editing a card, only when adding new cards. --Better runtime documentation for the '(De)activate cards' dialog (requested by +-Better runtime documentation for the '(De)activate cards' dialog (requested by Matthias Ernst). -Allow Cntl-C to copy text from question if answer is showing (reported by - Mathias Ernst). + Mathias Ernst). -Fix Windows-specific bug, where Mnemosyne would not notice that you were trying to open a backup and would not take the appropriate actions. --When running the sync server on e.g. a headless machine which does not have +-When running the sync server on e.g. a headless machine which does not have latex installed, don't waste time looking for updated latex cards. -Fix regression where a currently active set would not show up as highlighed - in the 'saved sets' panel when starting '(de)activate cards' (reported by + in the 'saved sets' panel when starting '(de)activate cards' (reported by Matthias Ernst). -Improve run-time help with respect to editing a saved set (requested by - Mathias Ernst). + Mathias Ernst). -To work around bugs in Qt under Linux, media are also played using - mplayer, just like under Windows (reported by Francesco Ariis). + mplayer, just like under Windows (reported by Francesco Ariis). -Fix problems with not detecting autorepeat when pressing grade buttons (patch by Kilian Evang). -Fix RTL issues (reported by Mateusz Konieczny). @@ -108,33 +205,33 @@ (Note that for Windows users we recommend uninstalling the previous version before installing the new one.) --Fix regression where it was not possible to grade map cards (reported by +-Fix regression where it was not possible to grade map cards (reported by Mateusz Konieczny). --Also allow mass conversion of cards to Cloze and Sentence card types - (requested by Chris Nadt). --Change ',' to ' - ' when importing legacy tag names (reported by Matthias +-Also allow mass conversion of cards to Cloze and Sentence card types + (requested by Chris Nadt). +-Change ',' to ' - ' when importing legacy tag names (reported by Matthias Ernst). --Fix some keyboard shortcuts while displaying map cards (reported by +-Fix some keyboard shortcuts while displaying map cards (reported by Mateusz Konieczny). Mnemosyne 2.3.2 : 2015-02-25 -Option to merge databases (under File - Import - Mnemosyne 2.x *.db files). --Make sure latex files are always pregenerated before sync (reported by Eric +-Make sure latex files are always pregenerated before sync (reported by Eric Freeman). -Fix error syncing filenames containing double dots (reported by Eric Freeman). --Strip control characters from strings when exporting and syncing (reported +-Strip control characters from strings when exporting and syncing (reported by Carl Kennedy). -Smart sorting of card types in dialog boxes (patch by Emilian Mihalache). -Fix when importing 1.x databases containing a single quote in a media filename (reported by Jan Egil Hagen). --Don't replace newline with
inside textarea tags (patch by Pete +-Don't replace newline with
inside textarea tags (patch by Pete Kovalenko). --Fix crash when running in headless mode after having run with the GUI +-Fix crash when running in headless mode after having run with the GUI (reported by Chris Nadt). -Fix handling of media filenames containing '#' (reported by Philip Gubser). --Don't crash the SQL engine if you have more than 1000 tags (reported by Mats +-Don't crash the SQL engine if you have more than 1000 tags (reported by Mats Hansson). -Fix regression in merging and editing duplicate cards (reported by Marcin M.). -Update the window title on a sync server if a different database was loaded. @@ -144,7 +241,7 @@ -Make sure we can run on systems with PyQt5 installed (patch by Nuno Araujo). -The "db_media:" tag now expands to an absolute path on all systems (reported by Gnome). --The local timezone is now stored in the science logs. +-The local timezone is now stored in the science logs. Mnemosyne 2.3.1 : 2014-06-18 @@ -157,7 +254,7 @@ when creating new clozes when editing a card (reported by Scott Youngman). -Fixed some issues with tabbing to buttons in a dialog not selecting the right button (reported by Scott Youngman). - + Mnemosyne 2.3 : 2014-04-23 @@ -169,7 +266,7 @@ This client has full support for the syncing protocol. -The functionality of mnemosyne-webserver has now been merged into the main program and can be activated through 'Configure Mnemosyne - servers'. --Time to create backups has decreased, in some situations even by a factor +-Time to create backups has decreased, in some situations even by a factor of 2 or more, speeding up syncing and program exit. -Sped up all editing operations in the card browser. -The name of the currently active saved set of cards is now listed in title @@ -184,14 +281,14 @@ in its previous location. -Keep the sort order in the card browser when editing cards (reported by Gnome and Tristan). --Added command line options --sync-server and --web-server which starts the - sync and the web server in headless mode (i.e. without a GUI) (useful to run +-Added command line options --sync-server and --web-server which starts the + sync and the web server in headless mode (i.e. without a GUI) (useful to run e.g. on a NAS server). -Fix more errors coming from loading config files (thanks to Alex Fevery for reporting this). -Added an extra popup to guide new people better through the learning process (feedback from Bjorn Maes). --Fix crash when exporting to cards format when Latex was not installed +-Fix crash when exporting to cards format when Latex was not installed (reported by Gwern). -Make card conversion more robust for badly formatted card (reported by Gnome). -When editing a card through the browser, make sure the correct set of tags is @@ -201,7 +298,7 @@ -Instruct people on the correct way to deal with '*.cards' files if they try to open it as a separate database (Kensor0). -Make it clearer what 'Find duplicates' does. --Various cosmetic fixes when importing *.cards files (reported by Ansgar +-Various cosmetic fixes when importing *.cards files (reported by Ansgar Bohmann). -Fix tag tree sometimes not updating correctly if the user adds a new tag. -People writing e.g. Javascript card and needing access to the full path of @@ -215,10 +312,10 @@ -Make Mnemosyne 1.x import more robust (reported by Jack Thro). -Don't allow saving the database to a network drive under Windows to prevent corruption (reported by Brendan Sinclair). --Fix sync error that could occur when adding and immediately deleting multiple +-Fix sync error that could occur when adding and immediately deleting multiple sister cards from the card browser. -Fix latex / cloze interaction corner case (reported by Daniele Parisi). --Fix corner case of overzealous introduction of media dir in expansion +-Fix corner case of overzealous introduction of media dir in expansion (reported by Toni Alsford). -Make sure latex images are always in sync when updating text. -If adding an extra tag when importing a 'cards' file, don't keep the tag @@ -653,7 +750,7 @@ -Support import of Supermemo for Palm databases that were converted to XML by smconv.pl from http://smconvpl.sourceforge.net (code by Felix Engel). -Make import of tab delimited files more robust (reported by nairbv). --Added new option in config.py (backups_to_keep) to be able to change the +-Added new option in config.py (max_backups) to be able to change the number of daily backups to keep. Set to -1 for no limit (requested by Patrick Kenny). -Added new option in config.py (day_starts_at) to be able to change the diff -Nru mnemosyne-2.4/.coveragerc mnemosyne-2.6+ds/.coveragerc --- mnemosyne-2.4/.coveragerc 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/.coveragerc 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,23 @@ +[run] +branch = True + +[report] +omit = + openSM2sync/tarfile.py + lib/* + tests/* + mnemosyne/pyqt_ui/* + /usr/* + dot_test/* + +exclude_lines = + pragma: no cover + def __repr__ + if self.debug: + if settings.DEBUG + raise AssertionError + raise NotImplementedError + if 0: + if __name__ == .__main__.: + pass + except ImportError: \ No newline at end of file diff -Nru mnemosyne-2.4/debian/changelog mnemosyne-2.6+ds/debian/changelog --- mnemosyne-2.4/debian/changelog 2017-01-13 02:29:11.000000000 +0000 +++ mnemosyne-2.6+ds/debian/changelog 2018-02-17 17:14:17.000000000 +0000 @@ -1,3 +1,21 @@ +mnemosyne (2.6+ds-1) unstable; urgency=medium + + * New upstream release. + * Update packaging: + - rewrite d/watch to point to github. + - rewrite d/copyright to conform to new standards + (and remove android files) + - bump std-ver to 4.1.3. + - bump dh compat to 10. + - drop patches (all upstream now). + - ship the documentation. + - change priority to optional. + - complete the desktop file. + - disable auto tests. + - use Python3 for everything. + + -- Julien Puydt Sat, 17 Feb 2018 18:14:17 +0100 + mnemosyne (2.4-0.1) unstable; urgency=medium [ Felix Gruber ] diff -Nru mnemosyne-2.4/debian/compat mnemosyne-2.6+ds/debian/compat --- mnemosyne-2.4/debian/compat 2017-01-10 23:03:57.000000000 +0000 +++ mnemosyne-2.6+ds/debian/compat 2018-02-17 17:14:17.000000000 +0000 @@ -1 +1 @@ -9 +10 diff -Nru mnemosyne-2.4/debian/control mnemosyne-2.6+ds/debian/control --- mnemosyne-2.4/debian/control 2017-01-13 02:29:11.000000000 +0000 +++ mnemosyne-2.6+ds/debian/control 2018-02-17 17:14:17.000000000 +0000 @@ -1,14 +1,14 @@ Source: mnemosyne Section: misc -Priority: extra +Priority: optional Maintainer: Robert Lemmen -Build-Depends: debhelper (>= 9), +Uploaders: Julien Puydt +Build-Depends: debhelper (>= 10), dh-python, - python3, + python3, python3-pyqt5, pyqt5-dev-tools, python3-setuptools, python3-sphinx -Standards-Version: 3.9.2 -X-Python3-Version: >= 3.5 +Standards-Version: 4.1.3 Homepage: http://www.mnemosyne-proj.org Package: mnemosyne diff -Nru mnemosyne-2.4/debian/copyright mnemosyne-2.6+ds/debian/copyright --- mnemosyne-2.4/debian/copyright 2017-01-13 02:29:11.000000000 +0000 +++ mnemosyne-2.6+ds/debian/copyright 2018-02-17 17:14:17.000000000 +0000 @@ -1,31 +1,696 @@ -This package was debianized by Robert Lemmen on -Mon, 17 Sep 2007 15:31:54 +0200. +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: mnemosyne +Upstream-Contact: https://github.com/mnemosyne-proj/mnemosyne/issues +Source: https://mnemosyne-proj.org/ +Files-Excluded: mnemosyne/android/* -It was downloaded from http://www.mnemosyne-proj.org/ +Files: * +Copyright: 2003-2018 Peter Bienstman et al. +License: AGPL-3-with-name-extra -Upstream Author: Peter Bienstman +Files: openSM2sync/* +Copyright: 2003-2018 Peter Bienstman et al. +License: LGPL-3 -Copyright: 2003-20012 Peter Bienstman et al +Files: debian/* +Copyright: 2007-2018 Robert Lemmen + 2018 Julien Puydt +License: LGPL-3 -License: +License: LGPL-3 + On Debian systems, the complete text of the GNU Lesser General + Public License version 3 can be found in "/usr/share/common-licenses/LGPL-3". - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License with - the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL; - if not, write to the Free Software Foundation, Inc., 51 Franklin St, - Fifth Floor, Boston, MA 02110-1301, USA. - - On Debian systems, the complete text of the GNU General Public - License, version 2, can be found in /usr/share/common-licenses/GPL-2. - -The Debian packaging is (C) 2007, Robert Lemmen and -is licensed under the GPL, see `/usr/share/common-licenses/GPL'. +License: AGPL-3-with-name-extra + Code from the Mnemosyne Project follows the AFFERO v3 licence + reproduced below, but with one extra provision: if your derived work + uses a non-trivial part of our code, the name "Mnemosyne" should be + cleary visible in your derived work, using a combination of + e.g. program name, window titles, logo's, about dialogs, etc, the + exact nature of which is to be discussed with Mnemosyne Project's + maintainers. + . + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + . + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies of this + license document, but changing it is not allowed. + . + Preamble + . + The GNU Affero General Public License is a free, copyleft license for + software and other kinds of works, specifically designed to ensure + cooperation with the community in the case of network server software. + . + The licenses for most software and other practical works are designed + to take away your freedom to share and change the works. By contrast, + our General Public Licenses are intended to guarantee your freedom to + share and change all versions of a program--to make sure it remains + free software for all its users. + . + When we speak of free software, we are referring to freedom, not price. + Our General Public Licenses are designed to make sure that you have the + freedom to distribute copies of free software (and charge for them if + you wish), that you receive source code or can get it if you want it, + that you can change the software or use pieces of it in new free + programs, and that you know you can do these things. + . + Developers that use our General Public Licenses protect your rights + with two steps: (1) assert copyright on the software, and (2) offer you + this License which gives you legal permission to copy, distribute + and/or modify the software. + . + A secondary benefit of defending all users' freedom is that + improvements made in alternate versions of the program, if they receive + widespread use, become available for other developers to incorporate. + Many developers of free software are heartened and encouraged by the + resulting cooperation. However, in the case of software used on + network servers, this result may fail to come about. The GNU General + Public License permits making a modified version and letting the public + access it on a server without ever releasing its source code to the + public. + . + The GNU Affero General Public License is designed specifically to + ensure that, in such cases, the modified source code becomes available + to the community. It requires the operator of a network server to + provide the source code of the modified version running there to the + users of that server. Therefore, public use of a modified version, on + a publicly accessible server, gives the public access to the source + code of the modified version. + . + An older license, called the Affero General Public License and + published by Affero, was designed to accomplish similar goals. This is + a different license, not a version of the Affero GPL, but Affero has + released a new version of the Affero GPL which permits relicensing + under this license. + . + The precise terms and conditions for copying, distribution and + modification follow. + . + TERMS AND CONDITIONS + . + 0. Definitions. + . + "This License" refers to version 3 of the GNU Affero General Public + License. + . + "Copyright" also means copyright-like laws that apply to other kinds of + works, such as semiconductor masks. + . + "The Program" refers to any copyrightable work licensed under this + License. Each licensee is addressed as "you". "Licensees" and + "recipients" may be individuals or organizations. + . + To "modify" a work means to copy from or adapt all or part of the work + in a fashion requiring copyright permission, other than the making of + an exact copy. The resulting work is called a "modified version" of + the earlier work or a work "based on" the earlier work. + . + A "covered work" means either the unmodified Program or a work based on + the Program. + . + To "propagate" a work means to do anything with it that, without + permission, would make you directly or secondarily liable for + infringement under applicable copyright law, except executing it on a + computer or modifying a private copy. Propagation includes copying, + distribution (with or without modification), making available to the + public, and in some countries other activities as well. + . + To "convey" a work means any kind of propagation that enables other + parties to make or receive copies. Mere interaction with a user + through a computer network, with no transfer of a copy, is not + conveying. + . + An interactive user interface displays "Appropriate Legal Notices" to + the extent that it includes a convenient and prominently visible + feature that (1) displays an appropriate copyright notice, and (2) + tells the user that there is no warranty for the work (except to the + extent that warranties are provided), that licensees may convey the + work under this License, and how to view a copy of this License. If the + interface presents a list of user commands or options, such as a menu, + a prominent item in the list meets this criterion. + . + 1. Source Code. + . + The "source code" for a work means the preferred form of the work for + making modifications to it. "Object code" means any non-source form of + a work. + . + A "Standard Interface" means an interface that either is an official + standard defined by a recognized standards body, or, in the case of + interfaces specified for a particular programming language, one that is + widely used among developers working in that language. + . + The "System Libraries" of an executable work include anything, other + than the work as a whole, that (a) is included in the normal form of + packaging a Major Component, but which is not part of that Major + Component, and (b) serves only to enable use of the work with that + Major Component, or to implement a Standard Interface for which an + implementation is available to the public in source code form. A "Major + Component", in this context, means a major essential component (kernel, + window system, and so on) of the specific operating system (if any) on + which the executable work runs, or a compiler used to produce the work, + or an object code interpreter used to run it. + . + The "Corresponding Source" for a work in object code form means all the + source code needed to generate, install, and (for an executable work) + run the object code and to modify the work, including scripts to + control those activities. However, it does not include the work's + System Libraries, or general-purpose tools or generally available free + programs which are used unmodified in performing those activities but + which are not part of the work. For example, Corresponding Source + includes interface definition files associated with source files for + the work, and the source code for shared libraries and dynamically + linked subprograms that the work is specifically designed to require, + such as by intimate data communication or control flow between those + subprograms and other parts of the work. + . + The Corresponding Source need not include anything that users can + regenerate automatically from other parts of the Corresponding Source. + . + The Corresponding Source for a work in source code form is that same + work. + . + 2. Basic Permissions. + . + All rights granted under this License are granted for the term of + copyright on the Program, and are irrevocable provided the stated + conditions are met. This License explicitly affirms your unlimited + permission to run the unmodified Program. The output from running a + covered work is covered by this License only if the output, given its + content, constitutes a covered work. This License acknowledges your + rights of fair use or other equivalent, as provided by copyright law. + . + You may make, run and propagate covered works that you do not convey, + without conditions so long as your license otherwise remains in force. + You may convey covered works to others for the sole purpose of having + them make modifications exclusively for you, or provide you with + facilities for running those works, provided that you comply with the + terms of this License in conveying all material for which you do not + control copyright. Those thus making or running the covered works for + you must do so exclusively on your behalf, under your direction and + control, on terms that prohibit them from making any copies of your + copyrighted material outside their relationship with you. + . + Conveying under any other circumstances is permitted solely under the + conditions stated below. Sublicensing is not allowed; section 10 makes + it unnecessary. + . + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + . + No covered work shall be deemed part of an effective technological + measure under any applicable law fulfilling obligations under article + 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar + laws prohibiting or restricting circumvention of such measures. + . + When you convey a covered work, you waive any legal power to forbid + circumvention of technological measures to the extent such + circumvention is effected by exercising rights under this License with + respect to the covered work, and you disclaim any intention to limit + operation or modification of the work as a means of enforcing, against + the work's users, your or third parties' legal rights to forbid + circumvention of technological measures. + . + 4. Conveying Verbatim Copies. + . + You may convey verbatim copies of the Program's source code as you + receive it, in any medium, provided that you conspicuously and + appropriately publish on each copy an appropriate copyright notice; + keep intact all notices stating that this License and any + non-permissive terms added in accord with section 7 apply to the code; + keep intact all notices of the absence of any warranty; and give all + recipients a copy of this License along with the Program. + . + You may charge any price or no price for each copy that you convey, and + you may offer support or warranty protection for a fee. + . + 5. Conveying Modified Source Versions. + . + You may convey a work based on the Program, or the modifications to + produce it from the Program, in the form of source code under the terms + of section 4, provided that you also meet all of these conditions: + . + a) The work must carry prominent notices stating that you modified it, + and giving a relevant date. + . + b) The work must carry prominent notices stating that it is released + under this License and any conditions added under section 7. This + requirement modifies the requirement in section 4 to "keep intact all + notices". + . + c) You must license the entire work, as a whole, under this License to + anyone who comes into possession of a copy. This License will + therefore apply, along with any applicable section 7 additional terms, + to the whole of the work, and all its parts, regardless of how they are + packaged. This License gives no permission to license the work in any + other way, but it does not invalidate such permission if you have + separately received it. + . + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your work + need not make them do so. + . + A compilation of a covered work with other separate and independent + works, which are not by their nature extensions of the covered work, + and which are not combined with it such as to form a larger program, in + or on a volume of a storage or distribution medium, is called an + "aggregate" if the compilation and its resulting copyright are not used + to limit the access or legal rights of the compilation's users beyond + what the individual works permit. Inclusion of a covered work in an + aggregate does not cause this License to apply to the other parts of + the aggregate. + . + 6. Conveying Non-Source Forms. + . + You may convey a covered work in object code form under the terms of + sections 4 and 5, provided that you also convey the machine-readable + Corresponding Source under the terms of this License, in one of these + ways: + . + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium customarily + used for software interchange. + . + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a written + offer, valid for at least three years and valid for as long as you + offer spare parts or customer support for that product model, to give + anyone who possesses the object code either (1) a copy of the + Corresponding Source for all the software in the product that is + covered by this License, on a durable physical medium customarily used + for software interchange, for a price no more than your reasonable cost + of physically performing this conveying of source, or (2) access to + copy the Corresponding Source from a network server at no charge. + . + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This alternative is + allowed only occasionally and noncommercially, and only if you received + the object code with such an offer, in accord with subsection 6b. + . + d) Convey the object code by offering access from a designated place + (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to copy + the object code is a network server, the Corresponding Source may be on + a different server (operated by you or a third party) that supports + equivalent copying facilities, provided you maintain clear directions + next to the object code saying where to find the Corresponding Source. + Regardless of what server hosts the Corresponding Source, you remain + obligated to ensure that it is available for as long as needed to + satisfy these requirements. + . + e) Convey the object code using peer-to-peer transmission, provided you + inform other peers where the object code and Corresponding Source of + the work are being offered to the general public at no charge under + subsection 6d. + . + A separable portion of the object code, whose source code is excluded + from the Corresponding Source as a System Library, need not be included + in conveying the object code work. + . + A "User Product" is either (1) a "consumer product", which means any + tangible personal property which is normally used for personal, family, + or household purposes, or (2) anything designed or sold for + incorporation into a dwelling. In determining whether a product is a + consumer product, doubtful cases shall be resolved in favor of + coverage. For a particular product received by a particular user, + "normally used" refers to a typical or common use of that class of + product, regardless of the status of the particular user or of the way + in which the particular user actually uses, or expects or is expected + to use, the product. A product is a consumer product regardless of + whether the product has substantial commercial, industrial or + non-consumer uses, unless such uses represent the only significant mode + of use of the product. + . + "Installation Information" for a User Product means any methods, + procedures, authorization keys, or other information required to + install and execute modified versions of a covered work in that User + Product from a modified version of its Corresponding Source. The + information must suffice to ensure that the continued functioning of + the modified object code is in no case prevented or interfered with + solely because modification has been made. + . + If you convey an object code work under this section in, or with, or + specifically for use in, a User Product, and the conveying occurs as + part of a transaction in which the right of possession and use of the + User Product is transferred to the recipient in perpetuity or for a + fixed term (regardless of how the transaction is characterized), the + Corresponding Source conveyed under this section must be accompanied by + the Installation Information. But this requirement does not apply if + neither you nor any third party retains the ability to install modified + object code on the User Product (for example, the work has been + installed in ROM). + . + The requirement to provide Installation Information does not include a + requirement to continue to provide support service, warranty, or + updates for a work that has been modified or installed by the + recipient, or for the User Product in which it has been modified or + installed. Access to a network may be denied when the modification + itself materially and adversely affects the operation of the network or + violates the rules and protocols for communication across the network. + . + Corresponding Source conveyed, and Installation Information provided, + in accord with this section must be in a format that is publicly + documented (and with an implementation available to the public in + source code form), and must require no special password or key for + unpacking, reading or copying. + . + 7. Additional Terms. + . + "Additional permissions" are terms that supplement the terms of this + License by making exceptions from one or more of its conditions. + Additional permissions that are applicable to the entire Program shall + be treated as though they were included in this License, to the extent + that they are valid under applicable law. If additional permissions + apply only to part of the Program, that part may be used separately + under those permissions, but the entire Program remains governed by + this License without regard to the additional permissions. + . + When you convey a copy of a covered work, you may at your option remove + any additional permissions from that copy, or from any part of it. + (Additional permissions may be written to require their own removal in + certain cases when you modify the work.) You may place additional + permissions on material, added by you to a covered work, for which you + have or can give appropriate copyright permission. + . + Notwithstanding any other provision of this License, for material you + add to a covered work, you may (if authorized by the copyright holders + of that material) supplement the terms of this License with terms: + . + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + . + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + . + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + . + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + . + e) Declining to grant rights under trademark law for use of some trade + names, trademarks, or service marks; or + . + f) Requiring indemnification of licensors and authors of that material + by anyone who conveys the material (or modified versions of it) with + contractual assumptions of liability to the recipient, for any + liability that these contractual assumptions directly impose on those + licensors and authors. + . + All other non-permissive additional terms are considered "further + restrictions" within the meaning of section 10. If the Program as you + received it, or any part of it, contains a notice stating that it is + governed by this License along with a term that is a further + restriction, you may remove that term. If a license document contains + a further restriction but permits relicensing or conveying under this + License, you may add to a covered work material governed by the terms + of that license document, provided that the further restriction does + not survive such relicensing or conveying. + . + If you add terms to a covered work in accord with this section, you + must place, in the relevant source files, a statement of the additional + terms that apply to those files, or a notice indicating where to find + the applicable terms. + . + Additional terms, permissive or non-permissive, may be stated in the + form of a separately written license, or stated as exceptions; the + above requirements apply either way. + . + 8. Termination. + . + You may not propagate or modify a covered work except as expressly + provided under this License. Any attempt otherwise to propagate or + modify it is void, and will automatically terminate your rights under + this License (including any patent licenses granted under the third + paragraph of section 11). + . + However, if you cease all violation of this License, then your license + from a particular copyright holder is reinstated (a) provisionally, + unless and until the copyright holder explicitly and finally terminates + your license, and (b) permanently, if the copyright holder fails to + notify you of the violation by some reasonable means prior to 60 days + after the cessation. + . + Moreover, your license from a particular copyright holder is reinstated + permanently if the copyright holder notifies you of the violation by + some reasonable means, this is the first time you have received notice + of violation of this License (for any work) from that copyright holder, + and you cure the violation prior to 30 days after your receipt of the + notice. + . + Termination of your rights under this section does not terminate the + licenses of parties who have received copies or rights from you under + this License. If your rights have been terminated and not permanently + reinstated, you do not qualify to receive new licenses for the same + material under section 10. + . + 9. Acceptance Not Required for Having Copies. + . + You are not required to accept this License in order to receive or run + a copy of the Program. Ancillary propagation of a covered work + occurring solely as a consequence of using peer-to-peer transmission to + receive a copy likewise does not require acceptance. However, nothing + other than this License grants you permission to propagate or modify + any covered work. These actions infringe copyright if you do not + accept this License. Therefore, by modifying or propagating a covered + work, you indicate your acceptance of this License to do so. + . + 10. Automatic Licensing of Downstream Recipients. + . + Each time you convey a covered work, the recipient automatically + receives a license from the original licensors, to run, modify and + propagate that work, subject to this License. You are not responsible + for enforcing compliance by third parties with this License. + . + An "entity transaction" is a transaction transferring control of an + organization, or substantially all assets of one, or subdividing an + organization, or merging organizations. If propagation of a covered + work results from an entity transaction, each party to that transaction + who receives a copy of the work also receives whatever licenses to the + work the party's predecessor in interest had or could give under the + previous paragraph, plus a right to possession of the Corresponding + Source of the work from the predecessor in interest, if the predecessor + has it or can get it with reasonable efforts. + . + You may not impose any further restrictions on the exercise of the + rights granted or affirmed under this License. For example, you may + not impose a license fee, royalty, or other charge for exercise of + rights granted under this License, and you may not initiate litigation + (including a cross-claim or counterclaim in a lawsuit) alleging that + any patent claim is infringed by making, using, selling, offering for + sale, or importing the Program or any portion of it. + . + 11. Patents. + . + A "contributor" is a copyright holder who authorizes use under this + License of the Program or a work on which the Program is based. The + work thus licensed is called the contributor's "contributor version". + . + A contributor's "essential patent claims" are all patent claims owned + or controlled by the contributor, whether already acquired or hereafter + acquired, that would be infringed by some manner, permitted by this + License, of making, using, or selling its contributor version, but do + not include claims that would be infringed only as a consequence of + further modification of the contributor version. For purposes of this + definition, "control" includes the right to grant patent sublicenses in + a manner consistent with the requirements of this License. + . + Each contributor grants you a non-exclusive, worldwide, royalty-free + patent license under the contributor's essential patent claims, to + make, use, sell, offer for sale, import and otherwise run, modify and + propagate the contents of its contributor version. + . + In the following three paragraphs, a "patent license" is any express + agreement or commitment, however denominated, not to enforce a patent + (such as an express permission to practice a patent or covenant not to + sue for patent infringement). To "grant" such a patent license to a + party means to make such an agreement or commitment not to enforce a + patent against the party. + . + If you convey a covered work, knowingly relying on a patent license, + and the Corresponding Source of the work is not available for anyone to + copy, free of charge and under the terms of this License, through a + publicly available network server or other readily accessible means, + then you must either (1) cause the Corresponding Source to be so + available, or (2) arrange to deprive yourself of the benefit of the + patent license for this particular work, or (3) arrange, in a manner + consistent with the requirements of this License, to extend the patent + license to downstream recipients. "Knowingly relying" means you have + actual knowledge that, but for the patent license, your conveying the + covered work in a country, or your recipient's use of the covered work + in a country, would infringe one or more identifiable patents in that + country that you have reason to believe are valid. + . + If, pursuant to or in connection with a single transaction or + arrangement, you convey, or propagate by procuring conveyance of, a + covered work, and grant a patent license to some of the parties + receiving the covered work authorizing them to use, propagate, modify + or convey a specific copy of the covered work, then the patent license + you grant is automatically extended to all recipients of the covered + work and works based on it. + . + A patent license is "discriminatory" if it does not include within the + scope of its coverage, prohibits the exercise of, or is conditioned on + the non-exercise of one or more of the rights that are specifically + granted under this License. You may not convey a covered work if you + are a party to an arrangement with a third party that is in the + business of distributing software, under which you make payment to the + third party based on the extent of your activity of conveying the work, + and under which the third party grants, to any of the parties who would + receive the covered work from you, a discriminatory patent license (a) + in connection with copies of the covered work conveyed by you (or + copies made from those copies), or (b) primarily for and in connection + with specific products or compilations that contain the covered work, + unless you entered into that arrangement, or that patent license was + granted, prior to 28 March 2007. + . + Nothing in this License shall be construed as excluding or limiting any + implied license or other defenses to infringement that may otherwise be + available to you under applicable patent law. + . + 12. No Surrender of Others' Freedom. + . + If conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do not + excuse you from the conditions of this License. If you cannot convey a + covered work so as to satisfy simultaneously your obligations under + this License and any other pertinent obligations, then as a consequence + you may not convey it at all. For example, if you agree to terms that + obligate you to collect a royalty for further conveying from those to + whom you convey the Program, the only way you could satisfy both those + terms and this License would be to refrain entirely from conveying the + Program. + . + 13. Remote Network Interaction; Use with the GNU General Public + License. + . + Notwithstanding any other provision of this License, if you modify the + Program, your modified version must prominently offer all users + interacting with it remotely through a computer network (if your + version supports such interaction) an opportunity to receive the + Corresponding Source of your version by providing access to the + Corresponding Source from a network server at no charge, through some + standard or customary means of facilitating copying of software. This + Corresponding Source shall include the Corresponding Source for any + work covered by version 3 of the GNU General Public License that is + incorporated pursuant to the following paragraph. + . + Notwithstanding any other provision of this License, you have + permission to link or combine any covered work with a work licensed + under version 3 of the GNU General Public License into a single + combined work, and to convey the resulting work. The terms of this + License will continue to apply to the part which is the covered work, + but the work with which it is combined will remain governed by version + 3 of the GNU General Public License. + . + 14. Revised Versions of this License. + . + The Free Software Foundation may publish revised and/or new versions of + the GNU Affero General Public License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. + . + Each version is given a distinguishing version number. If the Program + specifies that a certain numbered version of the GNU Affero General + Public License "or any later version" applies to it, you have the + option of following the terms and conditions either of that numbered + version or of any later version published by the Free Software + Foundation. If the Program does not specify a version number of the + GNU Affero General Public License, you may choose any version ever + published by the Free Software Foundation. + . + If the Program specifies that a proxy can decide which future versions + of the GNU Affero General Public License can be used, that proxy's + public statement of acceptance of a version permanently authorizes you + to choose that version for the Program. + . + Later license versions may give you additional or different + permissions. However, no additional obligations are imposed on any + author or copyright holder as a result of your choosing to follow a + later version. + . + 15. Disclaimer of Warranty. + . + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY + APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT + HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT + WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE + OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU + ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + . + 16. Limitation of Liability. + . + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR + CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES + ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT + NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES + SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO + OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY + HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + . + 17. Interpretation of Sections 15 and 16. + . + If the disclaimer of warranty and limitation of liability provided + above cannot be given local legal effect according to their terms, + reviewing courts shall apply local law that most closely approximates + an absolute waiver of all civil liability in connection with the + Program, unless a warranty or assumption of liability accompanies a + copy of the Program in return for a fee. + . + END OF TERMS AND CONDITIONS + . + How to Apply These Terms to Your New Programs + . + If you develop a new program, and you want it to be of the greatest + possible use to the public, the best way to achieve this is to make it + free software which everyone can redistribute and change under these + terms. + . + To do so, attach the following notices to the program. It is safest to + attach them to the start of each source file to most effectively state + the exclusion of warranty; and each file should have at least the + "copyright" line and a pointer to where the full notice is found. + . + + Copyright (C) + . + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + . + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public + License along with this program. If not, see + . + . + Also add information on how to contact you by electronic and paper + mail. + . + If your software can interact with users remotely through a computer + network, you should also make sure that it provides a way for users to + get its source. For example, if your program is a web application, its + interface could display a "Source" link that leads users to an archive + of the code. There are many ways you could offer source, and different + solutions will be better for different programs; see section 13 for the + specific requirements. + . + You should also get your employer (if you work as a programmer) or + school, if any, to sign a "copyright disclaimer" for the program, if + necessary. For more information on this, and how to apply and follow + the GNU AGPL, see . diff -Nru mnemosyne-2.4/debian/mnemosyne.doc-base mnemosyne-2.6+ds/debian/mnemosyne.doc-base --- mnemosyne-2.4/debian/mnemosyne.doc-base 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/debian/mnemosyne.doc-base 2018-02-17 17:14:17.000000000 +0000 @@ -0,0 +1,9 @@ +Document: mnemosyne +Title: Mnemosyne: spaced repetition flash-card program +Author: Peter Bienstman et al. +Abstract: This document describes mnemosyne +Section: Education + +Format: html +Index: /usr/share/doc/mnemosyne/html/index.html +Files: /usr/share/doc/mnemosyne/html/ diff -Nru mnemosyne-2.4/debian/patches/desktop_file_keywords.patch mnemosyne-2.6+ds/debian/patches/desktop_file_keywords.patch --- mnemosyne-2.4/debian/patches/desktop_file_keywords.patch 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/debian/patches/desktop_file_keywords.patch 2018-02-17 17:14:17.000000000 +0000 @@ -0,0 +1,11 @@ +Description: add keywords to the desktop file +Author: Julien Puydt +Forwarded: yes + +--- a/mnemosyne.desktop ++++ b/mnemosyne.desktop +@@ -6,3 +6,4 @@ + Categories=Education + Terminal=false + Type=Application ++Keywords=education;learning diff -Nru mnemosyne-2.4/debian/patches/doc_sources.patch mnemosyne-2.6+ds/debian/patches/doc_sources.patch --- mnemosyne-2.4/debian/patches/doc_sources.patch 2017-01-13 02:29:11.000000000 +0000 +++ mnemosyne-2.6+ds/debian/patches/doc_sources.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,766 +0,0 @@ -Description: Patch in doc sources from upstream - [ Scott Kitterman ] - * Add doc sources from upstream bzr to avoid sourceless javascript and - rebuild docs using sphinx -Author: Scott Kitterman -Origin: upstream -Forwarded: not-needed - ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/Makefile -@@ -0,0 +1,70 @@ -+# Makefile for Sphinx documentation -+# -+ -+# You can set these variables from the command line. -+SPHINXOPTS = -+SPHINXBUILD = sphinx-build -+PAPER = -+ -+# Internal variables. -+PAPEROPT_a4 = -D latex_paper_size=a4 -+PAPEROPT_letter = -D latex_paper_size=letter -+ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source -+ -+.PHONY: help clean html web pickle htmlhelp latex changes linkcheck -+ -+help: -+ @echo "Please use \`make ' where is one of" -+ @echo " html to make standalone HTML files" -+ @echo " pickle to make pickle files (usable by e.g. sphinx-web)" -+ @echo " htmlhelp to make HTML files and a HTML help project" -+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" -+ @echo " changes to make an overview over all changed/added/deprecated items" -+ @echo " linkcheck to check all external links for integrity" -+ -+clean: -+ -rm -rf build/* -+ -+html: -+ mkdir -p build/html build/doctrees -+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html -+ @echo -+ @echo "Build finished. The HTML pages are in build/html." -+ -+pickle: -+ mkdir -p build/pickle build/doctrees -+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle -+ @echo -+ @echo "Build finished; now you can process the pickle files or run" -+ @echo " sphinx-web build/pickle" -+ @echo "to start the sphinx-web server." -+ -+web: pickle -+ -+htmlhelp: -+ mkdir -p build/htmlhelp build/doctrees -+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp -+ @echo -+ @echo "Build finished; now you can run HTML Help Workshop with the" \ -+ ".hhp project file in build/htmlhelp." -+ -+latex: -+ mkdir -p build/latex build/doctrees -+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex -+ @echo -+ @echo "Build finished; the LaTeX files are in build/latex." -+ @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ -+ "run these through (pdf)latex." -+ -+changes: -+ mkdir -p build/changes build/doctrees -+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes -+ @echo -+ @echo "The overview file is in build/changes." -+ -+linkcheck: -+ mkdir -p build/linkcheck build/doctrees -+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck -+ @echo -+ @echo "Link check complete; look for any errors in the above output " \ -+ "or in build/linkcheck/output.txt." ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/conf.py -@@ -0,0 +1,181 @@ -+# -*- coding: utf-8 -*- -+# -+# libmnemosyne documentation build configuration file, created by -+# sphinx-quickstart on Sat Aug 9 10:59:10 2008. -+# -+# This file is execfile()d with the current directory set to its containing dir. -+# -+# The contents of this file are pickled, so don't put values in the namespace -+# that aren't pickleable (module imports are okay, they're removed automatically). -+# -+# All configuration values have a default value; values that are commented out -+# serve to show the default value. -+ -+import sys, os -+ -+# If your extensions are in another directory, add it here. If the directory -+# is relative to the documentation root, use os.path.abspath to make it -+# absolute, like shown here. -+ -+sys.path.insert(0,os.path.abspath("./../../../..")) -+ -+ -+# General configuration -+# --------------------- -+ -+# Add any Sphinx extension module names here, as strings. They can be extensions -+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest'] -+ -+# Add any paths that contain templates here, relative to this directory. -+templates_path = ['_templates'] -+ -+# The suffix of source filenames. -+source_suffix = '.rst' -+ -+# The master toctree document. -+master_doc = 'index' -+ -+# General substitutions. -+project = 'libmnemosyne' -+copyright = '2008, Peter Bienstman' -+ -+# The default replacements for |version| and |release|, also used in various -+# other places throughout the built documents. -+# -+# The short X.Y version. -+version = '2.0' -+# The full version, including alpha/beta/rc tags. -+release = '2.0' -+ -+# There are two options for replacing |today|: either, you set today to some -+# non-false value, then it is used: -+#today = '' -+# Else, today_fmt is used as the format for a strftime call. -+today_fmt = '%B %d, %Y' -+ -+# List of documents that shouldn't be included in the build. -+#unused_docs = [] -+ -+# List of directories, relative to source directories, that shouldn't be searched -+# for source files. -+#exclude_dirs = [] -+ -+# The reST default role (used for this markup: `text`) to use for all documents. -+#default_role = None -+ -+# If true, '()' will be appended to :func: etc. cross-reference text. -+#add_function_parentheses = True -+ -+# If true, the current module name will be prepended to all description -+# unit titles (such as .. function::). -+#add_module_names = True -+ -+# If true, sectionauthor and moduleauthor directives will be shown in the -+# output. They are ignored by default. -+#show_authors = False -+ -+# The name of the Pygments (syntax highlighting) style to use. -+pygments_style = 'sphinx' -+ -+ -+# Options for HTML output -+# ----------------------- -+ -+# The style sheet to use for HTML and HTML Help pages. A file of that name -+# must exist either in Sphinx' static/ path, or in one of the custom paths -+# given in html_static_path. -+html_style = 'default.css' -+ -+# The name for this set of Sphinx documents. If None, it defaults to -+# " v documentation". -+#html_title = None -+ -+# A shorter title for the navigation bar. Default is the same as html_title. -+#html_short_title = None -+ -+# The name of an image file (within the static path) to place at the top of -+# the sidebar. -+#html_logo = None -+ -+# The name of an image file (within the static path) to use as favicon of the -+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -+# pixels large. -+#html_favicon = None -+ -+# Add any paths that contain custom static files (such as style sheets) here, -+# relative to this directory. They are copied after the builtin static files, -+# so a file named "default.css" will overwrite the builtin "default.css". -+html_static_path = ['_static'] -+ -+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -+# using the given strftime format. -+html_last_updated_fmt = '%b %d, %Y' -+ -+# If true, SmartyPants will be used to convert quotes and dashes to -+# typographically correct entities. -+#html_use_smartypants = True -+ -+# Custom sidebar templates, maps document names to template names. -+#html_sidebars = {} -+ -+# Additional templates that should be rendered to pages, maps page names to -+# template names. -+#html_additional_pages = {} -+ -+# If false, no module index is generated. -+#html_use_modindex = True -+ -+# If false, no index is generated. -+#html_use_index = True -+ -+# If true, the index is split into individual pages for each letter. -+#html_split_index = False -+ -+# If true, the reST sources are included in the HTML build as _sources/. -+#html_copy_source = True -+ -+# If true, an OpenSearch description file will be output, and all pages will -+# contain a tag referring to it. The value of this option must be the -+# base URL from which the finished HTML is served. -+#html_use_opensearch = '' -+ -+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). -+#html_file_suffix = '' -+ -+# Output file base name for HTML help builder. -+htmlhelp_basename = 'libmnemosynedoc' -+ -+ -+# Options for LaTeX output -+# ------------------------ -+ -+# The paper size ('letter' or 'a4'). -+#latex_paper_size = 'letter' -+ -+# The font size ('10pt', '11pt' or '12pt'). -+#latex_font_size = '10pt' -+ -+# Grouping the document tree into LaTeX files. List of tuples -+# (source start file, target name, title, author, document class [howto/manual]). -+latex_documents = [ -+ ('index', 'libmnemosyne.tex', 'libmnemosyne Documentation', -+ 'Peter Bienstman', 'manual'), -+] -+ -+# The name of an image file (relative to this directory) to place at the top of -+# the title page. -+#latex_logo = None -+ -+# For "manual" documents, if this is true, then toplevel headings are parts, -+# not chapters. -+#latex_use_parts = False -+ -+# Additional stuff for the LaTeX preamble. -+#latex_preamble = '' -+ -+# Documents to append as an appendix to all manuals. -+#latex_appendices = [] -+ -+# If false, no module index is generated. -+#latex_use_modindex = True ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/index.rst -@@ -0,0 +1,101 @@ -+.. libmnemosyne documentation master file, created by sphinx-quickstart on Sat Aug 9 10:59:10 2008. -+ You can adapt this file completely to your liking, but it should at least -+ contain the root `toctree` directive. -+ -+Libmnemosyne overview -+============================== -+ -+Libmnemosyne consists of a number of components, which can be swapped in and -+out. This is handled by the ComponentManager. Examples of components are the -+scheduler, the storage layer, card types, plugins, ... -+ -+The basic unit of information from which Cards are derived is called a Fact, -+containing a set of fields and their associated values. E.g., for a three-sided -+CardType, these fields are foreign word, pronunciation and translation. -+ -+A FactView collects a number of the fields of a Fact into question and answers. -+E.g., the three-sided CardType has a recognition FactView, where the question -+contains the foreign word, and the answer contains the pronunciation and the -+translation. -+ -+As mentioned before, a Fact is linked to a CardType, and each CardType lists -+a set of FactViews. -+ -+The actual Cards are generated from the data in Fact using the recipe of a -+certain FactView. A Card also contains all the repetition data needed for the -+Scheduler to do its work. Since the question and answers are generated from -+the Fact data each time a Card is shown, related Cards (i.e. Cards with -+different FactViews of the same Fact) are always consistent. -+ -+The actual displaying of the data in a Card is handled by a RenderChain, which -+details the operations needed to get from the raw data in a Card to a -+representation of its question and answer, in a form either suitable for -+displaying in a browser, or exporting to a text file, ... . First the raw data -+is sent through Filters, which perform operations which can be useful for many -+card types, like expanding relative paths. Then this data is assembled in the -+right order in a Renderer, which can be card type specific. -+ -+At several points in the program, plugin writers can hook in their code using -+the Hook mechanism. -+ -+Before the data is passed to the Renderer, Filters can be applied to it. This -+is an extra level of flexibility, and can be used to generate LaTeX, convert -+relative paths to absolute paths, etc ... -+ -+To determine which cards are active (i.e.) participate in the review process, -+a mechanism of ActivityCriterion and CriterionApplier is used. -+ -+In order to make it easier for other GUI frontends to be written, all the logic -+typically needed for GUIs, but that is independent of the actual GUI toolkit -+used, is abstracted in controllers. In order to get more flexibility, there -+are two of them: one related to the review process (which is different for -+different schedulers), and one related to the rest of the program (which -+normally won't change). -+ -+There is also mechanism for plugins to add new statistical data to the standard -+statistics in an integrated way. -+ -+ -+Contents -+======== -+ -+.. toctree:: -+ :maxdepth: 2 -+ -+ modules/component -+ modules/component_manager -+ modules/fact -+ modules/fact_view -+ modules/tag -+ modules/tag_tree -+ modules/card_type -+ modules/card -+ modules/card_type_converter -+ modules/render_chain -+ modules/filter -+ modules/renderer -+ modules/controller -+ modules/review_controller -+ modules/configuration -+ modules/database -+ modules/file_format -+ modules/hook -+ modules/log_uploader -+ modules/logger -+ modules/plugin -+ modules/scheduler -+ modules/stopwatch -+ modules/statistics_page -+ modules/criterion -+ -+ modules/how_to_write_a_new_frontend -+ -+ -+Indices and tables -+================== -+ -+* :ref:`genindex` -+* :ref:`modindex` -+* :ref:`search` -+ -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/card.rst -@@ -0,0 +1,9 @@ -+:mod:`Card` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.card -+ -+.. autoclass:: Card -+ :members: -+ :undoc-members: -+ :inherited-members: ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/card_type.rst -@@ -0,0 +1,9 @@ -+:mod:`CardType` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.card_type -+ -+.. autoclass:: CardType -+ :members: -+ :undoc-members: -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/card_type_converter.rst -@@ -0,0 +1,9 @@ -+:mod:`CardTypeConverter` -+======================== -+ -+.. automodule:: mnemosyne.libmnemosyne.card_type_converter -+ -+.. autoclass:: CardTypeConverter -+ :members: -+ :undoc-members: -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/component.rst -@@ -0,0 +1,9 @@ -+:mod:`Component` -+====================== -+ -+.. automodule:: mnemosyne.libmnemosyne.component -+ -+.. autoclass:: Component -+ :members: -+ :undoc-members: -+ :inherited-members: ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/component_manager.rst -@@ -0,0 +1,9 @@ -+:mod:`ComponentManager` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.component_manager -+ -+.. autoclass:: ComponentManager -+ :members: -+ :undoc-members: -+ :inherited-members: ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/configuration.rst -@@ -0,0 +1,9 @@ -+:mod:`Configuration` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.configuration -+ -+.. autoclass:: Configuration -+ :members: -+ :undoc-members: -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/controller.rst -@@ -0,0 +1,9 @@ -+:mod:`Controller` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.controller -+ -+.. autoclass:: Controller -+ :members: -+ :undoc-members: -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/criterion.rst -@@ -0,0 +1,13 @@ -+:mod:`Criterion` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.criterion -+ -+.. autoclass:: Criterion -+ :members: -+ :undoc-members: -+ -+.. autoclass:: CriterionApplier -+ :members: -+ :undoc-members: -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/database.rst -@@ -0,0 +1,9 @@ -+:mod:`Database` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.database -+ -+.. autoclass:: Database -+ :members: -+ :undoc-members: -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/fact.rst -@@ -0,0 +1,9 @@ -+:mod:`Fact` -+=========== -+ -+.. automodule:: mnemosyne.libmnemosyne.fact -+ -+.. autoclass:: Fact -+ :members: -+ :undoc-members: -+ :inherited-members: ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/fact_view.rst -@@ -0,0 +1,9 @@ -+:mod:`FactView` -+====================== -+ -+.. automodule:: mnemosyne.libmnemosyne.fact_view -+ -+.. autoclass:: FactView -+ :members: -+ :undoc-members: -+ :inherited-members: ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/file_format.rst -@@ -0,0 +1,9 @@ -+:mod:`FileFormat` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.file_format -+ -+.. autoclass:: FileFormat -+ :members: -+ :undoc-members: -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/filter.rst -@@ -0,0 +1,9 @@ -+:mod:`Filter` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.filter -+ -+.. autoclass:: Filter -+ :members: -+ :undoc-members: -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/hook.rst -@@ -0,0 +1,9 @@ -+:mod:`Hook` -+============== -+ -+.. automodule:: mnemosyne.libmnemosyne.hook -+ -+.. autoclass:: Hook -+ :members: -+ :undoc-members: -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/how_to_write_a_new_frontend.rst -@@ -0,0 +1,84 @@ -+How to write a new frontend -+=========================== -+ -+libmnemosyne is designed in such a way that writing a new front is as painless as possible. All the code for running a GUI which is actually GUI toolkit independent is grouped in two controllers: the main ui controller and the review ui controller. In order to build a new frontend, you need to create a main widget which inherits from ``MainWidget`` and implements its interface, and similarly a review widget which inherits from ``ReviewWidget``. -+ -+In order to get a feel for how this works, it's best by starting to study the code for the ppygui_ui Windows Mobile client, which is the simplest possible frontend, as it only supports reviewing cards. -+ -+There are three files in that frontend: -+ -+* a startup script, which specifies which components your frontend wants to activate in libmnemosyne, whether you are running on a device which is resource limited, ... . -+ -+* a main widget, which corresponds to the application level widget in the GUI toolkit, and is in charge of showing error dialogs, displaying menus. -+ -+* the review widget, where you need to implement a.o. the code to display text in the question window, ... . -+ -+ -+To give a better feeling for how the division of labour between your own new GUI code and the GUI independent code in the controllers works, consider this example from the 'add cards' functionality in the PyQt frontend. -+ -+When the user activates the menu option or icon to add cards, it will fire up a certain function, which in the PyQt frontend is called ``add_cards()``:: -+ -+ QObject.connect(self.actionAddCards, SIGNAL("activated()"), MainWindow.add_cards) -+ -+The implementation of this function is rather trivial, it just calls the controller:: -+ -+ def add_cards(self): -+ self.controller().show_add_cards_dialog() -+ -+The code above is code you need to implement for your new frontend, but as you can see, it's rather trivial. -+ -+The controller's ``show_add_cards_dialog`` function looks like this:: -+ -+ def show_add_cards_dialog(self): -+ self.stopwatch().pause() -+ self.component_manager.get_current("add_cards_dialog")\ -+ (self.component_manager).activate() -+ review_controller = self.review_controller() -+ review_controller.reload_counters() -+ if review_controller.card is None: -+ review_controller.new_question() -+ else: -+ review_controller.update_status_bar() -+ self.stopwatch().unpause() -+ -+This is where the heavy lifting is done, but it's completely UI independent, and there should be no need for you to modify that code. -+ -+In order for the controller to know where it can find the actual add cards dialog, which for PyQt is called ``AddCardsDlg`` , you need to have that dialog derive from the abstract ``libmnemosyne.ui_components.dialogs.AddCardsDialog``, and provide an activate function, which for the PyQt toolkit is simply:: -+ -+ def activate(self): -+ self.exec_() -+ -+Finally, you need to register the ``AddCardsDlg`` component. That is what the following line does inside the main startup script (which for PyQt is simply called ``mnemosyne``):: -+ -+ mnemosyne.components.append(("mnemosyne.pyqt_ui.add_cards_dlg", -+ "AddCardsDlg")) -+ -+Inside the ``AddCardsDlg``, there is of course lots of UI specific code, but once the dialog has enough data to create the cards, it simply calls:: -+ -+ self.controller().create_new_cards(fact_data, card_type, grade, tag_names) -+ -+So, the ``AddCardsDlg`` should almost entirely consist of GUI dependent code. All the GUI indepedent code to actually create the cards is contained within the controller's ``create_new_cards()`` method. -+ -+If you feel like you need to override the review or the main controller provided by libmnemosyne, please let the developpers know. Either its design is not general enough, or you are trying to work against libmnemosyne rather than with it. -+ -+Tips for creating a responsive client: -+ -+* When instantiating a ``libmnemosyne.Mnemosyne`` object, there are two parameters you need to provide: ``upload_science_logs`` and ``interested_in_old_reps``. If you are writing a mobile client which syncs to a desktop version of mnemosyne, it is recommended that you don't deal with uploading the science logs yourself, but let the desktop client deal with that. As for ``interested_in_old_reps``, if your mobile client does not include graphical statistics using the revision history, it does not make sense to store this history on your device. -+* The standard instantiation of a ``libmnemosyne.Mnemosyne`` object includes all components in libmnemosyne. If you are writing a mobile client with e.g. only review capabilities, it does not make sense to include all these components. See the example of the Windows Mobile ppygui_ui frontend for a client which only uses the bare minimum of components to improve startup time. -+* If your mobile client does not include a card browser, you can save some disk space by not storing pregenerated questions or answers. To achieve this, make sure you do not include the regular ``SQLite`` component, but this one:: -+ -+ ("mnemosyne.libmnemosyne.databases.SQLite_no_pregenerated_data", -+ "SQLite_NoPregeneratedData") -+ -+* libmnemosyne does some optimisation by trying to show the next question before the grading of the previous question is completed. This improves the perceived responsiveness of the client. However, some GUI toolkits (e.g. Qt) queue widget updates and only excecute them when there is no more processing going on, thereby defeating libmnemosyne's optimisation. For that reason, there is a function ``review_widget().redraw_now`` which is used to tell the GUI toolkit to do the repaint now. If your toolkit also has similar behaviour, implementing this function can really help to mask slow database access. -+* If save operations are slow on your mobile device, you might want to consider setting a larger default value instead of ``save_after_n_reps = 1`` in ``config.py``. -+* If media files will never be edited outside of Mnemosyne on your mobile device, you can save time during sync by setting ``check_for_updated_media_files = False`` in ``config.py``. -+* If you are really adventurous, you can set ``backup_before_sync = True`` in ``config.py``. -+ -+ -+ -+Notes: -+ -+* If you need access to the main widget when you are constructing the review widget, e.g. to specify it's parent, you can access it using `self.main_widget()`` -+* If you need access to some components of libmnemosyne to construct your widget (e.g. the configuration), these might not yet be available inside your ``__init__()`` method. In this case, you need to move that code to your widget's ``activate()`` method, at which time all the other compoments will already be active. -+* Everything described here applies not only for Python frontends, but also for frontends not written in Python, which access libmnemosyne through an UDP socket or through the Python-embedded-in-C bridge. ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/log_uploader.rst -@@ -0,0 +1,9 @@ -+:mod:`LogUploader` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.log_uploader -+ -+.. autoclass:: LogUploader -+ :members: -+ :undoc-members: -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/logger.rst -@@ -0,0 +1,9 @@ -+:mod:`Logger` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.logger -+ -+.. autoclass:: Logger -+ :members: -+ :undoc-members: -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/plugin.rst -@@ -0,0 +1,9 @@ -+:mod:`Plugin` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.plugin -+ -+.. autoclass:: Plugin -+ :members: -+ :undoc-members: -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/render_chain.rst -@@ -0,0 +1,9 @@ -+:mod:`RenderChain` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.render_chain -+ -+.. autoclass:: RenderChain -+ :members: -+ :undoc-members: -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/renderer.rst -@@ -0,0 +1,9 @@ -+:mod:`Renderer` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.renderer -+ -+.. autoclass:: Renderer -+ :members: -+ :undoc-members: -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/review_controller.rst -@@ -0,0 +1,9 @@ -+:mod:`ReviewController` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.review_controller -+ -+.. autoclass:: ReviewController -+ :members: -+ :undoc-members: -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/scheduler.rst -@@ -0,0 +1,9 @@ -+:mod:`Scheduler` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.scheduler -+ -+.. autoclass:: Scheduler -+ :members: -+ :undoc-members: -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/statistics_page.rst -@@ -0,0 +1,16 @@ -+:mod:`StatisticsPage` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.statistics_page -+ -+.. autoclass:: StatisticsPage -+ :members: -+ :undoc-members: -+ -+.. autoclass:: PlotStatisticsPage -+ :members: -+ :undoc-members: -+ -+.. autoclass:: HtmlStatisticsPage -+ :members: -+ :undoc-members: ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/stopwatch.rst -@@ -0,0 +1,9 @@ -+:mod:`Stopwatch` -+=============================== -+ -+.. automodule:: mnemosyne.libmnemosyne.stopwatch -+ -+.. autoclass:: Stopwatch -+ :members: -+ :undoc-members: -+ ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/tag.rst -@@ -0,0 +1,9 @@ -+:mod:`Tag` -+========== -+ -+.. automodule:: mnemosyne.libmnemosyne.tag -+ -+.. autoclass:: Tag -+ :members: -+ :undoc-members: -+ :inherited-members: ---- /dev/null -+++ mnemosyne-2.4/mnemosyne/libmnemosyne/docs/source/modules/tag_tree.rst -@@ -0,0 +1,8 @@ -+:mod:`TagTree` -+============== -+ -+.. automodule:: mnemosyne.libmnemosyne.tag_tree -+ -+.. autoclass:: TagTree -+ :members: -+ :undoc-members: diff -Nru mnemosyne-2.4/debian/patches/manpages.patch mnemosyne-2.6+ds/debian/patches/manpages.patch --- mnemosyne-2.4/debian/patches/manpages.patch 2017-01-10 23:03:57.000000000 +0000 +++ mnemosyne-2.6+ds/debian/patches/manpages.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ ---- /dev/null -+++ b/mnemosyne.1 -@@ -0,0 +1,19 @@ -+.TH MNEMOSYNE 1 "" "Mnemosyne" "Spaced Repetition Flash-card Program" -+.SH NAME -+mnemosyne \- spaced repetition flash-card program -+.SH SYNOPSIS -+.B mnemosyne -+.RI [ options ] -+.SH DESCRIPTION -+The Mnemosyne software resembles a traditional flash-card program to help you -+memorise question/answer pairs, but with an important twist: it uses a -+sophisticated algorithm to schedule the best time for an item to come up for -+review. Difficult items that you tend to forget quickly will be scheduled more -+often, while Mnemosyne won't waste your time on things you remember well. -+ -+Since Mnemosyne is a GUI application it is usually not started from a shell, -+but from an X11 menu and doesn't take many options. For a few hints on how to -+use the software, see the homepage at http://www.mnemosyne-proj.org -+.SH AUTHOR -+mnemosyne was written by Peter Bienstman and friends -+ diff -Nru mnemosyne-2.4/debian/patches/series mnemosyne-2.6+ds/debian/patches/series --- mnemosyne-2.4/debian/patches/series 2017-01-13 02:29:11.000000000 +0000 +++ mnemosyne-2.6+ds/debian/patches/series 2018-02-17 17:14:17.000000000 +0000 @@ -1,2 +1,2 @@ -manpages.patch -doc_sources.patch +desktop_file_keywords.patch +use_python3.patch diff -Nru mnemosyne-2.4/debian/patches/use_python3.patch mnemosyne-2.6+ds/debian/patches/use_python3.patch --- mnemosyne-2.4/debian/patches/use_python3.patch 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/debian/patches/use_python3.patch 2018-02-17 17:14:17.000000000 +0000 @@ -0,0 +1,46 @@ +Description: make sure Python 3 is used everywhere +Author: Julien Puydt +Forwarded: yes + +--- a/makefile ++++ b/makefile +@@ -1,7 +1,7 @@ + # Choose the correct python and virtualenv commands: + + PYTHON := python +-SPHINXBUILD := sphinx-build ++SPHINXBUILD := "python3 -m sphinx" + + # If `python3` exists: + ifeq (1,$(shell python3 -c "print(1)" 2>&- )) +@@ -50,18 +50,18 @@ + cd po && make ../mo/de/LC_MESSAGES/mnemosyne.mo + + test: test-prep +- python -m nose tests ++ $(PYTHON) -m nose tests + + coverage: test-prep + rm -rf .coverage cover htmlcov +- python -m nose tests --with-coverage --cover-erase \ ++ $(PYTHON) -m nose tests --with-coverage --cover-erase \ + --cover-package=mnemosyne.libmnemosyne,openSM2sync || (echo "testsuite failed") + coverage html + @echo "Open file://$(PWD)/htmlcov/index.html in a browser for a nicer visualization." + + coverage-windows: FORCE + rm -rf .coverage cover htmlcov +- python -m nose tests --with-coverage --cover-erase \ ++ $(PYTHON) -m nose tests --with-coverage --cover-erase \ + --cover-package=mnemosyne.libmnemosyne,openSM2sync || (echo "testsuite failed") + coverage html + firefox htmlcov/index.html || chromium htmlcov/index.html || google-chrome htmlcov/index.html +@@ -70,7 +70,7 @@ + echo "from hotshot import stats" > process_profile.py + echo "s = stats.load(\"stats.dat\")" >> process_profile.py + echo "s.sort_stats(\"time\").print_stats()" >> process_profile.py +- python -m nose --with-profile --profile-stats-file=stats.dat ++ $(PYTHON) -m nose --with-profile --profile-stats-file=stats.dat + $(PYTHON) process_profile.py + + gui-profile: FORCE diff -Nru mnemosyne-2.4/debian/rules mnemosyne-2.6+ds/debian/rules --- mnemosyne-2.4/debian/rules 2017-01-13 02:29:11.000000000 +0000 +++ mnemosyne-2.6+ds/debian/rules 2018-02-17 17:14:17.000000000 +0000 @@ -6,6 +6,8 @@ %: dh $@ --with=python3,sphinxdoc --buildsystem=pybuild -override_dh_sphinxdoc: - rm -rf mnemosyne/libmnemosyne/docs/build/html - dh_sphinxdoc -Xjquery.js -Xunderscore.js -Xsearchtools.js +override_dh_auto_build: + make build-all-deps + +override_dh_auto_test: + # disable tests for now diff -Nru mnemosyne-2.4/debian/source.lintian-overrides mnemosyne-2.6+ds/debian/source.lintian-overrides --- mnemosyne-2.4/debian/source.lintian-overrides 2017-01-13 02:29:11.000000000 +0000 +++ mnemosyne-2.6+ds/debian/source.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -# The source is too there. -source: source-is-missing mnemosyne/libmnemosyne/docs/build/html/_static/jquery.js line length is 32086 characters (>512) -source: source-is-missing mnemosyne/libmnemosyne/docs/build/html/_static/underscore.js line length is 519 characters (>512) diff -Nru mnemosyne-2.4/debian/watch mnemosyne-2.6+ds/debian/watch --- mnemosyne-2.4/debian/watch 2017-01-10 23:03:57.000000000 +0000 +++ mnemosyne-2.6+ds/debian/watch 2018-02-17 17:14:17.000000000 +0000 @@ -1,2 +1,5 @@ -version=2 -http://sf.net/mnemosyne-proj/Mnemosyne-(.+)\.(?:zip|tgz|tbz2|txz|tar\.gz|tar\.bz2|tar\.xz) +version=4 +opts=\ +dversionmangle=s/\+(debian|dfsg|ds|deb)(\.\d+)?$//,\ +repacksuffix=+ds \ +https://github.com/mnemosyne-proj/mnemosyne/tags .*/archive/v?([\d\.]+).tar.gz diff -Nru mnemosyne-2.4/.gitattributes mnemosyne-2.6+ds/.gitattributes --- mnemosyne-2.4/.gitattributes 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/.gitattributes 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,3 @@ +*.mem binary +tests/files/basedir_bz2/config binary +tests/files/basedir_sch/config binary diff -Nru mnemosyne-2.4/.gitignore mnemosyne-2.6+ds/.gitignore --- mnemosyne-2.4/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/.gitignore 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,192 @@ +# Ignore files and directories created by the following commands: +# +# `make` +# `make setup` +# `make test` +# `make coverage` + +.coverage +dot_sync_A/ +dot_sync_B/ +dot_sync_C/ +dot_sync_client/ +dot_sync_server/ +dot_test/ +htmlcov/ +Mnemosyne.egg-info/ +bin/ +dot_mnemosyne2/ +include/ +lib/ +local/ +mnemosyne/**/*.pyc +mnemosyne/pyqt_ui/mnemosyne_rc.py +mnemosyne/pyqt_ui/tmp +mnemosyne/pyqt_ui/ui_* +mo/ +openSM2sync/**/*.pyc +tests/**/*.pyc +tests/files/basedir_to_merge/to_merge.db-journal +outside.db +outside.db-journal + + +# Created by https://www.gitignore.io/api/android,emacs,intellij,vim + +### Android ### +# Built application files +*.apk +*.ap_ + +# Files for the ART/Dalvik VM +*.dex + +# Java class files +*.class + +# Generated files +bin/ +gen/ +out/ + +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) +local.properties + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files +*.log + +# Android Studio Navigation editor temp files +.navigation/ + +# Android Studio captures folder +captures/ + +# Intellij +*.iml +.idea/workspace.xml + +# Keystore files +*.jks + +### Android Patch ### +gen-external-apklibs + + +### Emacs ### +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/workspace.xml +.idea/tasks.xml +.idea/dictionaries +.idea/vcs.xml +.idea/jsLibraryMappings.xml + +# Sensitive or high-churn files: +.idea/dataSources.ids +.idea/dataSources.xml +.idea/dataSources.local.xml +.idea/sqlDataSources.xml +.idea/dynamic.xml +.idea/uiDesigner.xml + +# Gradle: +.idea/gradle.xml +.idea/libraries + +# Mongo Explorer plugin: +.idea/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml + + +### Vim ### +# swap +[._]*.s[a-w][a-z] +[._]s[a-w][a-z] +# session +Session.vim +# temporary +.netrwhist +*~ +# auto-generated tag files +tags + +# osx build +venv/ diff -Nru mnemosyne-2.4/LICENSE mnemosyne-2.6+ds/LICENSE --- mnemosyne-2.4/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/LICENSE 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,4 @@ +Different parts of the software use different licenses: + +-mnemosyne itself uses AGPL v3 (see mnemosyne/LICENSE) +-openSM2sync uses LGPL v3 (see openSM2sync/LICENSE) diff -Nru mnemosyne-2.4/makefile mnemosyne-2.6+ds/makefile --- mnemosyne-2.4/makefile 2016-11-28 16:33:50.000000000 +0000 +++ mnemosyne-2.6+ds/makefile 2018-02-07 21:03:52.000000000 +0000 @@ -8,8 +8,8 @@ PYTHON := python3 endif # If we are on cygwin: -ifeq (1,$(shell /cygdrive/c/Program\ Files\ \(x86\)/Python35-32/python.exe -c "print(1)" 2>&- )) -PYTHON := /cygdrive/c/Program\ Files\ \(x86\)/Python35-32/python.exe +ifeq (1,$(shell /cygdrive/c/Program\ Files\ \(x86\)/Python36-32/python.exe -c "print(1)" 2>&- )) +PYTHON := /cygdrive/c/Program\ Files\ \(x86\)/Python36-32/python.exe endif # If `sphinx-build2` exists: ifneq (,$(shell command -v sphinx-build2 2>&- )) @@ -27,12 +27,12 @@ run: build # For debugging: running the code in place. PYTHONPATH=. $(PYTHON) mnemosyne/pyqt_ui/mnemosyne -d dot_mnemosyne2 - + build: # Just the bare minimum to get things running cd mnemosyne/pyqt_ui && make - cd mnemosyne/pyqt_ui && pyrcc5 -o mnemosyne_rc.py mnemosyne.qrc - + cd mnemosyne/pyqt_ui && pyrcc5 -o mnemosyne_rc.py mnemosyne.qrc + build-all-deps: # Also rebuilds the docs and the translations. cd mnemosyne/libmnemosyne/docs && make SPHINXBUILD=$(SPHINXBUILD) html @@ -41,45 +41,48 @@ cd mnemosyne/pyqt_ui && pyrcc5 -o mnemosyne_rc.py mnemosyne.qrc cd po && make update cd po && make - + install-system: build-all-deps $(PYTHON) setup.py install $(INSTALL_OPTS) rm -f -R build - -test: FORCE - nosetests tests - -coverage: FORCE + +test-prep: + cd po && make ../mo/de/LC_MESSAGES/mnemosyne.mo + +test: test-prep + python -m nose tests + +coverage: test-prep rm -rf .coverage cover htmlcov - ./bin/nosetests --with-coverage --cover-erase \ + python -m nose tests --with-coverage --cover-erase \ --cover-package=mnemosyne.libmnemosyne,openSM2sync || (echo "testsuite failed") - ./bin/coverage html - firefox htmlcov/index.html || chromium htmlcov/index.html || google-chrome htmlcov/index.html - + coverage html + @echo "Open file://$(PWD)/htmlcov/index.html in a browser for a nicer visualization." + coverage-windows: FORCE rm -rf .coverage cover htmlcov - Scripts/nosetests --with-coverage --cover-erase \ + python -m nose tests --with-coverage --cover-erase \ --cover-package=mnemosyne.libmnemosyne,openSM2sync || (echo "testsuite failed") - Scripts/coverage html + coverage html firefox htmlcov/index.html || chromium htmlcov/index.html || google-chrome htmlcov/index.html - + profile: FORCE echo "from hotshot import stats" > process_profile.py echo "s = stats.load(\"stats.dat\")" >> process_profile.py echo "s.sort_stats(\"time\").print_stats()" >> process_profile.py - ./bin/nosetests --with-profile --profile-stats-file=stats.dat + python -m nose --with-profile --profile-stats-file=stats.dat $(PYTHON) process_profile.py gui-profile: FORCE $(PYTHON) -m cProfile -s cumulative bin/mnemosyne -d ./dot_mnemosyne2/ | more - + gui-profile-windows: FORCE cp mnemosyne/pyqt_ui/mnemosyne tmp.py $(PYTHON) -m cProfile -s cumulative tmp.py -d C:\dot_test_2 | more benchmark: FORCE $(PYTHON) tests/benchmark.py - + windows-installer: FORCE # Erase previous directories to make sure we're clean. rm -rf dist @@ -96,7 +99,7 @@ make build-all-deps $(PYTHON) setup.py sdist --formats=gztar -osx: +macos: # Build the UI and the translations. cd mnemosyne/pyqt_ui && make cd po && make @@ -112,24 +115,27 @@ cp -R mo dist/Mnemosyne.app/Contents/Resources/share/locale ln -s ../Resources/share dist/Mnemosyne.app/Contents/MacOS/share - +osx: macos + android: # Creates the assets file with the Python code. rm -f mnemosyne/android/app/src/main/assets/mnemosyne.zip #python -m compileall mnemosyne zip -r mnemosyne/android/app/src/main/assets/mnemosyne.zip openSM2sync -i \*.py zip -r mnemosyne/android/app/src/main/assets/mnemosyne.zip mnemosyne/libmnemosyne -i \*.py zip -r mnemosyne/android/app/src/main/assets/mnemosyne.zip mnemosyne/cle -i \*.py - zip mnemosyne/android/app/src/main/assets/mnemosyne.zip mnemosyne/version.py mnemosyne/__init__.py - + zip mnemosyne/android/app/src/main/assets/mnemosyne.zip mnemosyne/version.py mnemosyne/__init__.py + clean: - rm -f *~ *.pyc *.tgz process_profile.py - rm -rf dist + rm -f *~ *.pyc *.tgz process_profile.py outside.db outside.db-journal + rm -f tests/files/basedir_to_merge/to_merge.db-journal + rm -rf dist .coverage rm -f -R Mnemosyne.egg-info rm -f -R distrib build bin lib Lib Scripts include dot_mnemosyne2 dot_test dot_sync_* rm -f -R dot_benchmark dist + find . -type d -path ".*/__pycache__" -print0 | xargs -0 rm -rf cd mnemosyne/pyqt_ui && make clean cd po && make clean rm -f mnemosyne/*~ mnemosyne/*.pyc rm -f mnemosyne/libmnemosyne/*~ mnemosyne/libmnemosyne/*.pyc - + FORCE: diff -Nru mnemosyne-2.4/MANIFEST.in mnemosyne-2.6+ds/MANIFEST.in --- mnemosyne-2.4/MANIFEST.in 2015-02-04 15:04:41.000000000 +0000 +++ mnemosyne-2.6+ds/MANIFEST.in 2018-02-07 21:03:52.000000000 +0000 @@ -4,4 +4,4 @@ include mnemosyne/example_scripts/*.py mnemosyne/example_scripts/README include mnemosyne/pyqt_ui/pixmaps/* pixmaps/* recursive-include mo * -recursive-include mnemosyne/libmnemosyne/docs/build/html * \ No newline at end of file +recursive-include mnemosyne/libmnemosyne/docs/ * \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/cle/activate_cards_dlg.py mnemosyne-2.6+ds/mnemosyne/cle/activate_cards_dlg.py --- mnemosyne-2.4/mnemosyne/cle/activate_cards_dlg.py 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/cle/activate_cards_dlg.py 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,25 @@ +# +# activate_cards_dlg.py +# + +from mnemosyne.libmnemosyne.ui_components.dialogs import ActivateCardsDialog + + +class ActivateCardsDlg(ActivateCardsDialog): + + def activate(self): + ActivateCardsDialog.activate(self) + self.criteria_by_name = {} + active_set_name = "" + active_criterion = self.database().current_criterion() + for criterion in self.database().criteria(): + if criterion._id != 1: + self.criteria_by_name[criterion.name] = criterion + if criterion == active_criterion: + active_set_name = criterion.name + self.component_manager.android.showActivateCardsDialog(\ + "____".join(sorted(self.criteria_by_name.keys())), active_set_name, self) + + def set_criterion_with_name(self, criterion_name): + self.database().set_current_criterion(self.criteria_by_name[criterion_name]) + \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/cle/android_render_chain.py mnemosyne-2.6+ds/mnemosyne/cle/android_render_chain.py --- mnemosyne-2.4/mnemosyne/cle/android_render_chain.py 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/cle/android_render_chain.py 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,29 @@ +# +# android_render_chain.py +# + +from mnemosyne.libmnemosyne.filters.latex import Latex +from mnemosyne.libmnemosyne.render_chain import RenderChain +from mnemosyne.libmnemosyne.renderers.html_css import HtmlCss +from mnemosyne.libmnemosyne.filters.RTL_handler import RTLHandler +from mnemosyne.libmnemosyne.filters.html5_video import Html5Video +from mnemosyne.libmnemosyne.filters.expand_paths import ExpandPaths +from mnemosyne.libmnemosyne.filters.escape_to_html import EscapeToHtml +from mnemosyne.libmnemosyne.filters.non_latin_font_size_increase import \ + NonLatinFontSizeIncrease + + +class AndroidRenderChain(RenderChain): + + """Renders either the question or answer as a complete web page. + + The ExpandPaths and EscapeToHtml filter needs to run after the + Latex filter. + + """ + + id = "default" + + filters = [Latex, EscapeToHtml, ExpandPaths, Html5Video, + RTLHandler, NonLatinFontSizeIncrease] + renderers = [HtmlCss] \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/cle/configuration.py mnemosyne-2.6+ds/mnemosyne/cle/configuration.py --- mnemosyne-2.4/mnemosyne/cle/configuration.py 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/cle/configuration.py 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,21 @@ +# +# configuration.py +# + +import os + +from mnemosyne.libmnemosyne.hook import Hook + + +class AndroidConfiguration(Hook): + + used_for = "configuration_defaults" + + def run(self): + for key, value in \ + list({"server_for_sync_as_client": "", + "port_for_sync_as_client": 8512, + "username_for_sync_as_client": "", + "password_for_sync_as_client": "", + }.items()): + self.config().setdefault(key, value) diff -Nru mnemosyne-2.4/mnemosyne/cle/database_maintenance.py mnemosyne-2.6+ds/mnemosyne/cle/database_maintenance.py --- mnemosyne-2.4/mnemosyne/cle/database_maintenance.py 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/cle/database_maintenance.py 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,19 @@ +# +# database_maintenance.py +# + +from mnemosyne.libmnemosyne.translator import _ +from mnemosyne.libmnemosyne.database import DatabaseMaintenance + + +class AndroidDatabaseMaintenance(DatabaseMaintenance): + + def run(self): + # Use shown_question here, since this is implemented to block. + answer = self.main_widget().show_question(\ +_("About to archive old logs to improve running speed. Depending on the size of your database and the speed of your device, this can take 10 minutes or more. Please leave Mnemosyne running in the foreground."), + _("OK, proceed"), "", "") + if answer == 0: + DatabaseMaintenance.run(self) + + \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/cle/main_widget.py mnemosyne-2.6+ds/mnemosyne/cle/main_widget.py --- mnemosyne-2.4/mnemosyne/cle/main_widget.py 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/cle/main_widget.py 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,67 @@ +# +# main_wdgt.py +# + +from mnemosyne.libmnemosyne.ui_components.main_widget import MainWidget + +class MainWdgt(MainWidget): + + def __init__(self, component_manager): + MainWidget.__init__(self, component_manager) + self.is_progress_bar_showing = False + self.progress_bar_current_value = 0 + self.progress_bar_update_interval = 1 + self.progress_bar_last_shown_value = 0 + + def show_information(self, text): + if self.is_progress_bar_showing: + self.close_progress() + self.component_manager.android.Log("Mnemosyne", text.encode("utf-8")) + self.component_manager.android.showInformation(text.encode("utf-8")) + + def show_question(self, text, option0, option1, option2): + if self.is_progress_bar_showing: + self.close_progress() + return self.component_manager.android.showQuestion(\ + text.encode("utf-8"), option0.encode("utf-8"), + option1.encode("utf-8"), option2.encode("utf-8")) + + def show_error(self, text): + self.show_information(text) + + def set_progress_text(self, text): + if self.is_progress_bar_showing: + self.close_progress() + self.component_manager.android.setProgressText(text.encode("utf-8")) + self.progress_bar_update_interval = 1 + self.progress_bar_current_value = 0 + self.progress_bar_last_shown_value = 0 + self.is_progress_bar_showing = True + + def set_progress_range(self, maximum): + self.component_manager.android.setProgressRange(maximum) + + def set_progress_update_interval(self, update_interval): + update_interval = int(update_interval) + if update_interval == 0: + update_interval = 1 + self.progress_bar_update_interval = update_interval + + def increase_progress(self, value): + self.set_progress_value(self.progress_bar_current_value + value) + + def set_progress_value(self, value): + # There is a possibility that 'value' does not visit all intermediate + # integer values in the range, so we need to check and store the last + # shown and the current value here. + self.progress_bar_current_value = value + if value - self.progress_bar_last_shown_value >= \ + self.progress_bar_update_interval: + self.component_manager.android.setProgressValue(value) + self.progress_bar_last_shown_value = value + + def close_progress(self): + self.is_progress_bar_showing = False + self.component_manager.android.closeProgress() + + \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/cle/mnemosyne_android.py mnemosyne-2.6+ds/mnemosyne/cle/mnemosyne_android.py --- mnemosyne-2.4/mnemosyne/cle/mnemosyne_android.py 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/cle/mnemosyne_android.py 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,137 @@ +# +# mnemosyne_android.py +# + +import os +# Workaround for this bug: +# https://github.com/pyinstaller/pyinstaller/issues/1113 +import encodings.idna + +# Initialise Mnemosyne. +from mnemosyne.libmnemosyne import Mnemosyne +mnemosyne = Mnemosyne(upload_science_logs=False, interested_in_old_reps=True) + + +mnemosyne.components = [\ + ("mnemosyne.libmnemosyne.translators.no_translator", + "NoTranslator"), + ("mnemosyne.libmnemosyne.databases.SQLite", + "SQLite"), + ("mnemosyne.cle.database_maintenance", + "AndroidDatabaseMaintenance"), + ("mnemosyne.libmnemosyne.configuration", + "Configuration"), + ("mnemosyne.libmnemosyne.loggers.database_logger", + "DatabaseLogger"), + ("mnemosyne.libmnemosyne.schedulers.SM2_mnemosyne", + "SM2Mnemosyne"), + ("mnemosyne.libmnemosyne.stopwatch", + "Stopwatch"), + ("mnemosyne.libmnemosyne.card_types.front_to_back", + "FrontToBack"), + ("mnemosyne.libmnemosyne.card_types.both_ways", + "BothWays"), + ("mnemosyne.libmnemosyne.card_types.vocabulary", + "Vocabulary"), + ("mnemosyne.libmnemosyne.card_types.both_ways", + "FrontToBackToBothWays"), + ("mnemosyne.libmnemosyne.card_types.both_ways", + "BothWaysToFrontToBack"), + ("mnemosyne.libmnemosyne.card_types.vocabulary", + "FrontToBackToVocabulary"), + ("mnemosyne.libmnemosyne.card_types.vocabulary", + "BothWaysToVocabulary"), + ("mnemosyne.libmnemosyne.card_types.vocabulary", + "VocabularyToFrontToBack"), + ("mnemosyne.libmnemosyne.card_types.vocabulary", + "VocabularyToBothWays"), + ("mnemosyne.libmnemosyne.render_chains.plain_text_chain", + "PlainTextChain"), + ("mnemosyne.libmnemosyne.filters.latex", + "CheckForUpdatedLatexFiles"), + ("mnemosyne.libmnemosyne.filters.latex", + "LatexFilenamesFromData"), + ("mnemosyne.libmnemosyne.filters.latex", + "DeleteUnusedLatexFiles"), + ("mnemosyne.libmnemosyne.filters.latex", + "PreprocessClozeLatex"), + ("mnemosyne.libmnemosyne.filters.latex", + "PostprocessQAClozeLatex"), + ("mnemosyne.libmnemosyne.controllers.default_controller", + "DefaultController"), + ("mnemosyne.libmnemosyne.study_modes.scheduled_forgotten_new", + "ScheduledForgottenNew"), + ("mnemosyne.libmnemosyne.study_modes.new_only", + "NewOnly"), + ("mnemosyne.libmnemosyne.study_modes.cram_all", + "CramAll"), + ("mnemosyne.libmnemosyne.study_modes.cram_recent", + "CramRecent"), + ("mnemosyne.libmnemosyne.card_types.map", + "MapPlugin"), + ("mnemosyne.libmnemosyne.card_types.cloze", + "ClozePlugin"), + ("mnemosyne.libmnemosyne.card_types.sentence", + "SentencePlugin"), + ("mnemosyne.libmnemosyne.card_types.M_sided", + "MSided"), + ("mnemosyne.libmnemosyne.criteria.default_criterion", + "DefaultCriterion"), + ("mnemosyne.libmnemosyne.databases.SQLite_criterion_applier", + "DefaultCriterionApplier"), + ("mnemosyne.libmnemosyne.statistics_pages.schedule", + "Schedule"), + ("mnemosyne.libmnemosyne.statistics_pages.retention_score", + "RetentionScore"), + ("mnemosyne.libmnemosyne.statistics_pages.cards_added", + "CardsAdded"), + ("mnemosyne.libmnemosyne.statistics_pages.cards_learned", + "CardsLearned"), + ("mnemosyne.libmnemosyne.statistics_pages.grades", + "Grades"), + ("mnemosyne.libmnemosyne.statistics_pages.easiness", + "Easiness"), + ("mnemosyne.libmnemosyne.statistics_pages.current_card", + "CurrentCard"), + ("mnemosyne.cle.main_widget", + "MainWdgt"), + ("mnemosyne.cle.configuration", + "AndroidConfiguration"), + ("mnemosyne.cle.android_render_chain", + "AndroidRenderChain"), + ("mnemosyne.cle.sync_dlg", + "SyncDlg"), + ("mnemosyne.cle.activate_cards_dlg", + "ActivateCardsDlg")] + +mnemosyne.gui_for_component["ScheduledForgottenNew"] = [\ + ("mnemosyne.cle.review_widget", + "ReviewWdgt")] +mnemosyne.gui_for_component["NewOnly"] = [\ + ("mnemosyne.cle.review_widget", + "ReviewWdgt")] +mnemosyne.gui_for_component["CramAll"] = [\ + ("mnemosyne.cle.review_widget", + "ReviewWdgt")] +mnemosyne.gui_for_component["CramRecent"] = [\ + ("mnemosyne.cle.review_widget", + "ReviewWdgt")] + +def start_mnemosyne(data_dir, filename, wrapper): + try: + mnemosyne.android = wrapper + mnemosyne.initialise(data_dir=data_dir, filename=filename) + mnemosyne.start_review() + except Exception as e: + print(e) + import traceback + traceback.print_exc() + traceback.print_stack() + print(traceback.format_stack()) + +def pause_mnemosyne(): + mnemosyne.database().save() + mnemosyne.config().save() + +def stop_mnemosyne(): + mnemosyne.finalise() diff -Nru mnemosyne-2.4/mnemosyne/cle/review_widget.py mnemosyne-2.6+ds/mnemosyne/cle/review_widget.py --- mnemosyne-2.4/mnemosyne/cle/review_widget.py 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/cle/review_widget.py 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,87 @@ +# +# review_wdgt.py +# + +from mnemosyne.libmnemosyne.ui_components.review_widget import ReviewWidget + + +class ReviewWdgt(ReviewWidget): + + def redraw_now(self): + pass + + def empty(self): + background = "white" + if self.review_controller().card: + colour = self.config().card_type_property(\ + "background_colour", self.review_controller().card.card_type) + if colour: + background = ("%X" % colour)[2:] # Strip alpha. + return """ + + +
+
""" + + def show_answer(self): + self.review_controller().show_answer() + + def grade_answer(self, grade): + self.review_controller().grade_answer(grade) + + def set_question_box_visible(self, is_visible): + self.component_manager.android.setQuestionBoxVisible(is_visible) + + def set_answer_box_visible(self, is_visible): + self.component_manager.android.setAnswerBoxVisible(is_visible) + + def set_question_label(self, text): + self.component_manager.android.setQuestionLabel(text.encode("utf-8")) + + def set_question(self, text): + self.question = text + + def set_answer(self, text): + self.answer = text + + def reveal_question(self): + self.component_manager.android.setQuestion(\ + self.question.encode("utf-8")) + + def reveal_answer(self, process_audio=True): + self.component_manager.android.setAnswer(\ + self.answer.encode("utf-8"), process_audio) + + def clear_question(self): + self.question = self.empty() + self.reveal_question() + + def clear_answer(self): + # We don't process the audio here, as that would kill the pending + # audio events from the question. + self.answer = self.empty() + self.reveal_answer(process_audio=False) + + def update_show_button(self, text, is_default, is_enabled): + self.component_manager.android.updateShowButton(\ + text.encode("utf-8"), is_default, is_enabled) + + def set_grades_enabled(self, is_enabled): + self.component_manager.android.setGradesEnabled(is_enabled) + + def set_default_grade(self, grade): + pass + + def update_status_bar_counters(self): + scheduled_count, non_memorised_count, active_count = \ + self.review_controller().counters() + counters = "Sch.: %d Not mem.: %d Act.: %d" % \ + (scheduled_count, non_memorised_count, active_count) + self.component_manager.android.setStatusbarText(counters) + diff -Nru mnemosyne-2.4/mnemosyne/cle/sync_dlg.py mnemosyne-2.6+ds/mnemosyne/cle/sync_dlg.py --- mnemosyne-2.4/mnemosyne/cle/sync_dlg.py 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/cle/sync_dlg.py 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,16 @@ +# +# sync_dlg.py +# + +from mnemosyne.libmnemosyne.ui_components.dialogs import SyncDialog + + +class SyncDlg(SyncDialog): + + def __init__(self, component_manager): + SyncDialog.__init__(self, component_manager) + + def activate(self): + SyncDialog.activate(self) + self.component_manager.android.showSyncDialog() + \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/embedded_in_C/dlgs.c mnemosyne-2.6+ds/mnemosyne/embedded_in_C/dlgs.c --- mnemosyne-2.4/mnemosyne/embedded_in_C/dlgs.c 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/embedded_in_C/dlgs.c 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,95 @@ +// +// dlgs.c +// +// Template, to be replaced by functions which actually do something useful +// in a specific client. +// + +#include +#include +#include "python_bridge.h" + +void add_cards_dlg_activate() +{ + printf("add_cards_dlg\n"); + + // Simple example with hard coded data instead of user input. + run_python( + "fact_data = {\"q\": \"question\", \"a\": \"answer\"}\n" + "card_type = mnemosyne.card_type_with_id(\"1\")\n" + "mnemosyne.controller().create_new_cards(fact_data, card_type, grade=-1, tag_names=[\"default\"])\n"); + printf("Added a card\n"); +} + + +void edit_card_dlg_activate(char* card_id, int allow_cancel) +{ + printf("edit_card_dlg: %s %d\n", card_id, allow_cancel); +} + + +void activate_cards_dlg_activate() +{ + printf("activate_cards_dlg\n"); +} + + +void browse_cards_dlg_activate() +{ + printf("browse_cards_dlg\n"); +} + + +void card_appearance_dlg_activate() +{ + printf("card_appearance_dlg\n"); +} + + +void activate_plugins_dlg_activate() +{ + printf("activate_plugins_dlg\n"); +} + + +void manage_card_types_dlg_activate() +{ + printf("manage_card_types_dlg\n"); +} + + +void statistics_dlg_activate() +{ + printf("statistics_dlg\n"); +} + + +void configuration_dlg_activate() +{ + printf("configuration_dlg\n"); +} + + +void sync_dlg_activate() +{ + printf("sync_dlg\n"); + // The majority of the following sync related settings are fixed for + // each client, which is why they are hard-coded here instead of + // putting them in the config(). + run_python( + "from openSM2sync.client import Client\n" + "import mnemosyne.version as mnemosyne_version\n" + "client = Client(mnemosyne.config().machine_id(), mnemosyne.database(), mnemosyne.main_widget())\n" + "client.program_name = \"Mnemosyne\"\n" + "client.program_version = mnemosyne_version\n" + "client.capabilities = \"mnemosyne_dynamic_cards\"\n" + "client.check_for_edited_local_media_files = False\n" + "client.interested_in_old_reps = False\n" + "client.store_pregenerated_data = False\n" + "client.do_backup = True\n" + "client.upload_science_logs = False\n" + "try:\n" + " client.sync(\"server\", 8512, \"username\", \"password\")\n" + "finally:\n" + " client.database.release_connection()\n"); +} \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/embedded_in_C/dlgs.h mnemosyne-2.6+ds/mnemosyne/embedded_in_C/dlgs.h --- mnemosyne-2.4/mnemosyne/embedded_in_C/dlgs.h 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/embedded_in_C/dlgs.h 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,23 @@ +// +// dlgs.h +// + +void add_cards_dlg_activate(); + +void edit_card_dlg_activate(char* card_id, int allow_cancel); + +void activate_cards_dlg_activate(); + +void browse_cards_dlg_activate(); + +void card_appearance_dlg_activate(); + +void activate_plugins_dlg_activate(); + +void manage_card_types_dlg_activate(); + +void statistics_dlg_activate(); + +void configuration_dlg_activate(); + +void sync_dlg_activate(); diff -Nru mnemosyne-2.4/mnemosyne/embedded_in_C/dlgs.py mnemosyne-2.6+ds/mnemosyne/embedded_in_C/dlgs.py --- mnemosyne-2.4/mnemosyne/embedded_in_C/dlgs.py 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/embedded_in_C/dlgs.py 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,70 @@ +# +# dlgs.py +# + +import _dlgs as _ +import mnemosyne.libmnemosyne.ui_components.dialogs as dialogs + + +class AddCardsDlg(dialogs.AddCardsDialog): + + def activate(self): + _.add_cards_dlg_activate() + + +class EditCardDlg(dialogs.EditCardDialog): + + def __init__(self, card, component_manager, allow_cancel=True): + self.card = card + self.allow_cancel = allow_cancel + + def activate(self): + _.edit_card_dlg_activate(self.card.id, self.allow_cancel) + + +class ActivateCardsDlg(dialogs.ActivateCardsDialog): + + def activate(self): + _.activate_cards_dlg_activate() + + +class BrowseCardsDlg(dialogs.BrowseCardsDialog): + + def activate(self): + _.browse_cards_dlg_activate() + + +class CardAppearanceDlg(dialogs.CardAppearanceDialog): + + def activate(self): + _.card_appearance_dlg_activate() + + +class ActivatePluginsDlg(dialogs.ActivatePluginsDialog): + + def activate(self): + _.activate_plugins_dlg_activate() + + +class ManageCardTypesDlg(dialogs.ManageCardTypesDialog): + + def activate(self): + _.manage_card_types_dlg_activate() + + +class StatisticsDlg(dialogs.StatisticsDialog): + + def activate(self): + _.statistics_dlg_activate() + + +class ConfigurationDlg(dialogs.ConfigurationDialog): + + def activate(self): + _.configuration_dlg_activate() + + +class SyncDlg(dialogs.SyncDialog): + + def activate(self): + _.sync_dlg_activate() diff -Nru mnemosyne-2.4/mnemosyne/embedded_in_C/example_client.c mnemosyne-2.6+ds/mnemosyne/embedded_in_C/example_client.c --- mnemosyne-2.4/mnemosyne/embedded_in_C/example_client.c 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/embedded_in_C/example_client.c 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,49 @@ +// +// mnemosyne.c +// + +// Very simple client illustrating the basic structure of a frontend which +// embeds Mnemosyne in C. +// Also consult 'How to write a new frontend' in the docs of libmnemosyne for +// more information about the interaction between libmnemosyne and a frontend. + +#include +#include "python_bridge.h" + +int main(int argc, char* argv[]) +{ + // Initialise Python bridge. + start_python_bridge(); + + // Run a few Python commands to initialise Mnemosyne. + run_python( + "import sys\n" + "sys.path.insert(0, \"/home/pbienst/source/mnemosyne-proj-pbienst/mnemosyne\")\n" + "from mnemosyne.libmnemosyne import Mnemosyne\n" + "mnemosyne = Mnemosyne(upload_science_logs=False, interested_in_old_reps=False)\n" + "mnemosyne.components.insert(0, (\"mnemosyne.libmnemosyne.translator\", \"GetTextTranslator\"))\n" + "mnemosyne.components.append((\"mnemosyne.embedded_in_C.main_wdgt\", \"MainWdgt\"))\n" + "mnemosyne.components.append((\"mnemosyne.embedded_in_C.review_wdgt\", \"ReviewWdgt\"))\n" + "mnemosyne.components.append((\"mnemosyne.embedded_in_C.dlgs\", \"AddCardsDlg\"))\n" + "mnemosyne.components.append((\"mnemosyne.embedded_in_C.dlgs\", \"EditCardDlg\"))\n" + "mnemosyne.components.append((\"mnemosyne.embedded_in_C.dlgs\", \"SyncDlg\"))\n" + "mnemosyne.initialise(data_dir=\"/home/pbienst/source/mnemosyne-proj-pbienst/mnemosyne/dot_mnemosyne2\", filename=\"default.db\")\n" + "mnemosyne.start_review()\n" + "mnemosyne.controller().show_add_cards_dialog()\n" + "mnemosyne.review_controller().show_answer()\n" + "mnemosyne.review_controller().grade_answer(0)\n" +); + + // For syncing, the python code looks something like this: + // mnemosyne.controller().sync(server, port, username, password) + + // Illustration on how to get data from Python to C. + char result[256]; + eval_python_as_unicode("mnemosyne.database().card_count()\n", + result, sizeof(result)); + printf("card count: %s\n", result); + + // Termination. + run_python("mnemosyne.finalise()"); + stop_python_bridge(); +} diff -Nru mnemosyne-2.4/mnemosyne/embedded_in_C/main_wdgt.c mnemosyne-2.6+ds/mnemosyne/embedded_in_C/main_wdgt.c --- mnemosyne-2.4/mnemosyne/embedded_in_C/main_wdgt.c 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/embedded_in_C/main_wdgt.c 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,114 @@ +// +// main_wdgt.c +// +// Template, to be replaced by functions which actually do something useful +// in a specific client. +// + +#include +#include + +void main_wdgt_set_window_title(char* text) +{ + printf("set_window_title: %s\n", text); +} + + +void main_wdgt_show_information(char* text) +{ + printf("show_information: %s\n", text); +} + + +int main_wdgt_show_question(char* text, char* option_0, char* option_1, + char* option_2) +{ + printf("show_question: %s, %s, %s, %s\n", text, option_0, option_1, + option_2); + // As an example, we hardcode the reply. + return 0; +} + + +void main_wdgt_show_error(char* text) +{ + printf("show_error: %s\n", text); +} + + +void main_wdgt_get_filename_to_open(char* path, char* filter, char *caption, + char* filename, int str_size) +{ + printf("get_filename_to_open: %s, %s, %s\n", path, filter, caption); + // As an example, we hardcode the reply. + strncpy(filename, "example_path", str_size); +} + + +void main_wdgt_get_filename_to_save(char* path, char* filter, char *caption, + char* filename, int str_size) +// Should warn about overwriting existing file. +{ + printf("get_filename_to_save: %s, %s, %s\n", path, filter, caption); + // As an example, we hardcode the reply. + strncpy(filename, "example_path", str_size); +} + + +void main_wdgt_set_status_bar_message(char* text) +{ + printf("set_status_bar_message: %s\n", text); +} + + +void main_wdgt_set_progress_text(char* text) +{ + printf("set_progress_text: %s\n", text); +} + + +void main_wdgt_set_progress_range(int max) +{ + printf("set_progress_range: %d\n", max); +} + + +void main_wdgt_set_progress_update_interval(int interval) +{ + printf("set_progress_update_interval: %d\n", interval); +} + + +void main_wdgt_increase_progress(int value) +{ + printf("increase_progress: %d\n", value); +} + +void main_wdgt_set_progress_value(int value) +{ + printf("set_progress_value: %d\n", value); +} + + +void main_wdgt_close_progress() +{ + printf("close_progress\n"); +} + + +void main_wdgt_enable_edit_current_card(int is_enabled) +{ + printf("enable_edit_current_card: %d\n", is_enabled); +} + + +void main_wdgt_enable_delete_current_card(int is_enabled) +{ + printf("enable_delete_current_card: %d\n", is_enabled); +} + + +void main_wdgt_enable_browse_cards(int is_enabled) +{ + printf("enable_browse_cards: %d\n", is_enabled); +} diff -Nru mnemosyne-2.4/mnemosyne/embedded_in_C/main_wdgt.h mnemosyne-2.6+ds/mnemosyne/embedded_in_C/main_wdgt.h --- mnemosyne-2.4/mnemosyne/embedded_in_C/main_wdgt.h 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/embedded_in_C/main_wdgt.h 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,50 @@ +// +// main_wdgt.h +// + +void main_wdgt_set_window_title(char* text); + +void main_wdgt_show_information(char* text); + +int main_wdgt_show_question(char* text, char* option_0, char* option_1, + char* option_2); + +void main_wdgt_show_error(char* text); + +void main_wdgt_get_filename_to_open(char* path, char* filter, char *caption, + char* filename, int str_size); + +void main_wdgt_get_filename_to_save(char* path, char* filter, char *caption, + char* filename, int str_size); +// Should warn about overwriting existing file. + + +void main_wdgt_set_status_bar_message(char* text); + + +void main_wdgt_set_progress_text(char* text); + + +void main_wdgt_set_progress_range(int max); + + +void main_wdgt_set_progress_update_interval(int interval); + + +void main_wdgt_increase_progress(int value); + + +void main_wdgt_set_progress_value(int value); + + +void main_wdgt_close_progress(); + + +void main_wdgt_enable_edit_current_card(int is_enabled); + + +void main_wdgt_enable_delete_current_card(int is_enabled); + + +void main_wdgt_enable_browse_cards(int is_enabled); + diff -Nru mnemosyne-2.4/mnemosyne/embedded_in_C/main_wdgt.py mnemosyne-2.6+ds/mnemosyne/embedded_in_C/main_wdgt.py --- mnemosyne-2.4/mnemosyne/embedded_in_C/main_wdgt.py 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/embedded_in_C/main_wdgt.py 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,61 @@ +# +# main_wdgt.py +# + +import _main_wdgt as _ +from mnemosyne.libmnemosyne.ui_components.main_widget import MainWidget + + +class MainWdgt(MainWidget): + + def set_window_title(self, text): + _.set_window_title(text.encode("utf-8")) + + def show_information(self, text): + _.show_information(text.encode("utf-8")) + + def show_question(self, text, option0, option1, option2=""): + return _.show_question(text.encode("utf-8"), + option0.encode("utf-8"), option1.encode("utf-8"), + option2.encode("utf-8")) + + def show_error(self, text): + _.show_information(text.encode("utf-8")) + + def get_filename_to_open(self, path, filter, caption=""): + return _.get_filename_to_open(path.encode("utf-8"), + filter.encode("utf-8"), caption.encode("utf-8")) + + def get_filename_to_save(self, path, filter, caption=""): + return _.get_filename_to_save(path.encode("utf-8"), + filter.encode("utf-8"), caption.encode("utf-8")) + + def set_status_bar_message(self, text): + _.set_status_bar_message(text.encode("utf-8")) + + def set_progress_text(self, text): + _.set_progress_text(text.encode("utf-8")) + + def set_progress_range(self, maximum): + _.set_progress_range(maximum) + + def set_progress_update_interval(self, update_interval): + _.set_progress_update_interval(update_interval) + + def increase_progress(self, value): + _.increase_progress(value) + + def set_progress_value(self, value): + _.set_progress_value(value) + + def close_progress(self): + _.close_progress() + + def enable_edit_current_card(self, is_enabled): + _.enable_edit_current_card(is_enabled) + + def enable_delete_current_card(self, is_enabled): + _.enable_delete_current_card(is_enabled) + + def enable_browse_cards(self, is_enabled): + _.enable_browse_cards(is_enabled) diff -Nru mnemosyne-2.4/mnemosyne/embedded_in_C/makefile mnemosyne-2.6+ds/mnemosyne/embedded_in_C/makefile --- mnemosyne-2.4/mnemosyne/embedded_in_C/makefile 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/embedded_in_C/makefile 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,23 @@ +CC = gcc +CFLAGS = -O -I/usr/include/python2.6 +LD = $(CC) +LDFLAGS = -lpython2.6 +RM = rm + +EXE = mnemosyne +SRCS = python_bridge.c main_wdgt.c review_wdgt.c dlgs.c python_stdout_stderr.c \ + example_client.c +OBJS = ${SRCS:.c=.o} + +.c.o : + $(CC) $(CFLAGS) -c $< + +all : $(EXE) + +$(EXE) : $(OBJS) + $(LD) $(LDFLAGS) -o $@ $(OBJS) + +$(OBJS) : python_bridge.h main_wdgt.h review_wdgt.h dlgs.h python_stdout_stderr.h + +clean : + -$(RM) -f $(EXE) $(OBJS) diff -Nru mnemosyne-2.4/mnemosyne/embedded_in_C/python_bridge.c mnemosyne-2.6+ds/mnemosyne/embedded_in_C/python_bridge.c --- mnemosyne-2.4/mnemosyne/embedded_in_C/python_bridge.c 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/embedded_in_C/python_bridge.c 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,684 @@ +// +// python_bridge.c +// + +#define STR_SIZE 128 + +#include +#include +#include + +#include "dlgs.h" +#include "main_wdgt.h" +#include "review_wdgt.h" +#include "python_stdout_stderr.h" + +// +// Functions relating to main widget. +// + +static PyObject* _main_wdgt_set_window_title(PyObject* self, PyObject* args) +{ + char* text = NULL; + if (!PyArg_ParseTuple(args, "s", &text)) + return NULL; + main_wdgt_set_window_title(text); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _main_wdgt_show_information(PyObject* self, PyObject* args) +{ + char* text = NULL; + if (!PyArg_ParseTuple(args, "s", &text)) + return NULL; + main_wdgt_show_information(text); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _main_wdgt_show_question(PyObject* self, PyObject* args) +{ + char* text = NULL; + char* option_0 = NULL; + char* option_1 = NULL; + char* option_2 = NULL; + if (!PyArg_ParseTuple(args, "ssss", &text, &option_0, &option_1, + &option_2)) + return NULL; + int answer; + answer = main_wdgt_show_question(text, option_0, option_1, option_2); + return Py_BuildValue("i", answer); +} + + +static PyObject* _main_wdgt_show_error(PyObject* self, PyObject* args) +{ + char* text = NULL; + if (!PyArg_ParseTuple(args, "s", &text)) + return NULL; + main_wdgt_show_error(text); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _main_wdgt_get_filename_to_open(PyObject* self, + PyObject* args) +{ + char* path = NULL; + char* filter = NULL; + char* caption = NULL; + if (!PyArg_ParseTuple(args, "sss", &path, &filter, &caption)) + return NULL; + char filename[STR_SIZE+1]; + main_wdgt_get_filename_to_open(path, filter, caption, filename, STR_SIZE); + return PyUnicode_FromString(filename); +} + + +static PyObject* _main_wdgt_get_filename_to_save(PyObject* self, + PyObject* args) +{ + char* path = NULL; + char* filter = NULL; + char* caption = NULL; + if (!PyArg_ParseTuple(args, "sss", &path, &filter, &caption)) + return NULL; + char filename[STR_SIZE+1]; + main_wdgt_get_filename_to_save(path, filter, caption, filename, STR_SIZE); + return PyUnicode_FromString(filename); +} + + +static PyObject* _main_wdgt_set_status_bar_message(PyObject* self, + PyObject* args) +{ + char* text = NULL; + if (!PyArg_ParseTuple(args, "s", &text)) + return NULL; + main_wdgt_set_status_bar_message(text); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _main_wdgt_set_progress_text(PyObject* self, PyObject* args) +{ + char* text = NULL; + if (!PyArg_ParseTuple(args, "s", &text)) + return NULL; + main_wdgt_set_progress_text(text); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _main_wdgt_set_progress_range(PyObject* self, PyObject* args) +{ + int min = 0; + int max = 0; + if (!PyArg_ParseTuple(args, "ii", &min, &max)) + return NULL; + main_wdgt_set_progress_range(min, max); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _main_wdgt_set_progress_update_interval(PyObject* self, + PyObject* args) +{ + int interval = 0; + if (!PyArg_ParseTuple(args, "i", &interval)) + return NULL; + main_wdgt_set_progress_update_interval(interval); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _main_wdgt_set_progress_value(PyObject* self, PyObject* args) +{ + int value = 0; + if (!PyArg_ParseTuple(args, "i", &value)) + return NULL; + main_wdgt_set_progress_value(value); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _main_wdgt_close_progress(PyObject* self, PyObject* args) +{ + main_wdgt_close_progress(); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _main_wdgt_enable_edit_current_card(PyObject* self, + PyObject* args) +{ + int is_enabled = 0; + if (!PyArg_ParseTuple(args, "i", &is_enabled)) + return NULL; + main_wdgt_enable_edit_current_card(is_enabled); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _main_wdgt_enable_delete_current_card(PyObject* self, + PyObject* args) +{ + int is_enabled = 0; + if (!PyArg_ParseTuple(args, "i", &is_enabled)) + return NULL; + main_wdgt_enable_delete_current_card(is_enabled); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _main_wdgt_enable_browse_cards(PyObject* self, + PyObject* args) +{ + int is_enabled = 0; + if (!PyArg_ParseTuple(args, "i", &is_enabled)) + return NULL; + main_wdgt_enable_browse_cards(is_enabled); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyMethodDef main_wdgt_methods[] = { + {"set_window_title", _main_wdgt_set_window_title, + METH_VARARGS, ""}, + {"show_information", _main_wdgt_show_information, + METH_VARARGS, ""}, + {"show_question", _main_wdgt_show_question, + METH_VARARGS, ""}, + {"show_error", _main_wdgt_show_error, + METH_VARARGS, ""}, + {"get_filename_to_open", _main_wdgt_get_filename_to_open, + METH_VARARGS, ""}, + {"get_filename_to_save", _main_wdgt_get_filename_to_save, + METH_VARARGS, ""}, + {"set_status_bar_message", _main_wdgt_set_status_bar_message, + METH_VARARGS, ""}, + {"set_progress_text", _main_wdgt_set_progress_text, + METH_VARARGS, ""}, + {"set_progress_range", _main_wdgt_set_progress_range, + METH_VARARGS, ""}, + {"set_progress_update_interval", _main_wdgt_set_progress_update_interval, + METH_VARARGS, ""}, + {"set_progress_value", _main_wdgt_set_progress_value, + METH_VARARGS, ""}, + {"close_progress", _main_wdgt_close_progress, + METH_VARARGS, ""}, + {"enable_edit_current_card", _main_wdgt_enable_edit_current_card, + METH_VARARGS, ""}, + {"enable_delete_current_card", _main_wdgt_enable_delete_current_card, + METH_VARARGS, ""}, + {"enable_browse_cards", _main_wdgt_enable_browse_cards, + METH_VARARGS, ""}, + {NULL, NULL, 0, NULL} +}; + + +PyMODINIT_FUNC +init__main_wdgt(void) +{ + Py_InitModule("_main_wdgt", main_wdgt_methods); +} + + + +// +// Functions relating to review widget. +// + +static PyObject* _review_wdgt_set_question_box_visible(PyObject* self, + PyObject* args) +{ + int is_visible = 0; + if (!PyArg_ParseTuple(args, "i", &is_visible)) + return NULL; + review_wdgt_set_question_box_visible(is_visible); + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject* _review_wdgt_set_answer_box_visible(PyObject* self, + PyObject* args) +{ + int is_visible = 0; + if (!PyArg_ParseTuple(args, "i", &is_visible)) + return NULL; + review_wdgt_set_answer_box_visible(is_visible); + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject* _review_wdgt_set_question_label(PyObject* self, + PyObject* args) +{ + char* text = NULL; + if (!PyArg_ParseTuple(args, "s", &text)) + return NULL; + review_wdgt_set_question_label(text); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _review_wdgt_set_question(PyObject* self, PyObject* args) +{ + char* text = NULL; + if (!PyArg_ParseTuple(args, "s", &text)) + return NULL; + review_wdgt_set_question(text); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _review_wdgt_set_answer(PyObject* self, PyObject* args) +{ + char* text = NULL; + if (!PyArg_ParseTuple(args, "s", &text)) + return NULL; + review_wdgt_set_answer(text); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _review_wdgt_clear_question(PyObject* self, PyObject* args) +{ + review_wdgt_clear_question(); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _review_wdgt_clear_answer(PyObject* self, PyObject* args) +{ + review_wdgt_clear_answer(); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _review_wdgt_update_show_button(PyObject* self, + PyObject* args) +{ + char* text = NULL; + int is_default = 0; + int is_enabled = 0; + if (!PyArg_ParseTuple(args, "sii", &text, &is_enabled, &is_default)) + return NULL; + review_wdgt_update_show_button(text, is_enabled, is_default); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _review_wdgt_set_grades_enabled(PyObject* self, + PyObject* args) +{ + int is_enabled = 0; + if (!PyArg_ParseTuple(args, "i", &is_enabled)) + return NULL; + review_wdgt_set_grades_enabled(is_enabled); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _review_wdgt_set_grade_enabled(PyObject* self, PyObject* args) +{ + int grade = 0; + int is_enabled = 0; + if (!PyArg_ParseTuple(args, "ii", &grade, &is_enabled)) + return NULL; + review_wdgt_set_grade_enabled(grade, is_enabled); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _review_wdgt_set_default_grade(PyObject* self, PyObject* args) +{ + int grade = 0; + if (!PyArg_ParseTuple(args, "i", &grade)) + return NULL; + review_wdgt_set_default_grade(grade); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _review_wdgt_set_grades_title(PyObject* self, PyObject* args) +{ + char* text = NULL; + if (!PyArg_ParseTuple(args, "s", &text)) + return NULL; + review_wdgt_set_grades_title(text); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _review_wdgt_set_grade_text(PyObject* self, PyObject* args) +{ + int grade = 0; + char* text = NULL; + if (!PyArg_ParseTuple(args, "is", &grade, &text)) + return NULL; + review_wdgt_set_grade_text(grade, text); + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject* _review_wdgt_set_grade_tooltip(PyObject* self, PyObject* args) +{ + int grade = 0; + char* text = NULL; + if (!PyArg_ParseTuple(args, "is", &grade, &text)) + return NULL; + review_wdgt_set_grade_tooltip(grade, text); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _review_wdgt_update_status_bar_counters(PyObject* self, + PyObject* args) +{ + review_wdgt_update_status_bar_counters(); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject* _review_wdgt_redraw_now(PyObject* self, PyObject* args) +{ + review_wdgt_redraw_now(); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyMethodDef review_wdgt_methods[] = { + {"set_question_box_visible", _review_wdgt_set_question_box_visible, + METH_VARARGS, ""}, + {"set_answer_box_visible", _review_wdgt_set_answer_box_visible, + METH_VARARGS, ""}, + {"set_question_label", _review_wdgt_set_question_label, + METH_VARARGS, ""}, + {"set_question", _review_wdgt_set_question, + METH_VARARGS, ""}, + {"set_answer", _review_wdgt_set_answer, + METH_VARARGS, ""}, + {"clear_question", _review_wdgt_clear_question, + METH_VARARGS, ""}, + {"clear_answer", _review_wdgt_clear_answer, + METH_VARARGS, ""}, + {"update_show_button", _review_wdgt_update_show_button, + METH_VARARGS, ""}, + {"set_grades_enabled", _review_wdgt_set_grades_enabled, + METH_VARARGS, ""}, + {"set_grade_enabled", _review_wdgt_set_grade_enabled, + METH_VARARGS, ""}, + {"set_default_grade", _review_wdgt_set_default_grade, + METH_VARARGS, ""}, + {"set_grades_title", _review_wdgt_set_grades_title, + METH_VARARGS, ""}, + {"set_grade_text", _review_wdgt_set_grade_text, + METH_VARARGS, ""}, + {"set_grade_tooltip", _review_wdgt_set_grade_tooltip, + METH_VARARGS, ""}, + {"update_status_bar_counters", _review_wdgt_update_status_bar_counters, + METH_VARARGS, ""}, + {"redraw_now", _review_wdgt_redraw_now, + METH_VARARGS, ""}, + {NULL, NULL, 0, NULL} +}; + + +PyMODINIT_FUNC +init__review_wdgt(void) +{ + Py_InitModule("_review_wdgt", review_wdgt_methods); +} + + + +// +// Functions relating to dialogs. +// + +PyObject* _add_cards_dlg_activate(PyObject* self, PyObject* args) +{ + add_cards_dlg_activate(); + Py_INCREF(Py_None); + return Py_None; +} + + +PyObject* _edit_card_dlg_activate(PyObject* self, PyObject* args) +{ + char* card_id = NULL; + int allow_cancel = 1; + if (!PyArg_ParseTuple(args, "si", &card_id, &allow_cancel)) + return NULL; + edit_card_dlg_activate(card_id, allow_cancel); + Py_INCREF(Py_None); + return Py_None; +} + + +PyObject* _activate_cards_dlg_activate(PyObject* self, PyObject* args) +{ + activate_cards_dlg_activate(); + Py_INCREF(Py_None); + return Py_None; +} + + +PyObject* _browse_cards_dlg_activate(PyObject* self, PyObject* args) +{ + browse_cards_dlg_activate(); + Py_INCREF(Py_None); + return Py_None; +} + + +PyObject* _card_appearance_dlg_activate(PyObject* self, PyObject* args) +{ + card_appearance_dlg_activate(); + Py_INCREF(Py_None); + return Py_None; +} + + +PyObject* _activate_plugins_dlg_activate(PyObject* self, PyObject* args) +{ + activate_plugins_dlg_activate(); + Py_INCREF(Py_None); + return Py_None; +} + + +PyObject* _manage_card_types_dlg_activate(PyObject* self, PyObject* args) +{ + manage_card_types_dlg_activate(); + Py_INCREF(Py_None); + return Py_None; +} + + +PyObject* _statistics_dlg_activate(PyObject* self, PyObject* args) +{ + statistics_dlg_activate(); + Py_INCREF(Py_None); + return Py_None; +} + + +PyObject* _configuration_dlg_activate(PyObject* self, PyObject* args) +{ + configuration_dlg_activate(); + Py_INCREF(Py_None); + return Py_None; +} + + +PyObject* _sync_dlg_activate(PyObject* self, PyObject* args) +{ + sync_dlg_activate(); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyMethodDef dlgs_methods[] = { + {"add_cards_dlg_activate", _add_cards_dlg_activate, + METH_VARARGS, ""}, + {"edit_card_dlg_activate", _edit_card_dlg_activate, + METH_VARARGS, ""}, + {"activate_cards_dlg_activate", _activate_cards_dlg_activate, + METH_VARARGS, ""}, + {"browse_cards_dlg_activate", _browse_cards_dlg_activate, + METH_VARARGS, ""}, + {"card_appearance_dlg_activate", _card_appearance_dlg_activate, + METH_VARARGS, ""}, + {"activate_plugins_dlg_activate", _activate_plugins_dlg_activate, + METH_VARARGS, ""}, + {"manage_card_types_dlg_activate", _manage_card_types_dlg_activate, + METH_VARARGS, ""}, + {"statistics_dlg_activate", _statistics_dlg_activate, + METH_VARARGS, ""}, + {"configuration_dlg_activate", _configuration_dlg_activate, + METH_VARARGS, ""}, + {"sync_dlg_activate", _sync_dlg_activate, + METH_VARARGS, ""}, + {NULL, NULL, 0, NULL} +}; + + +PyMODINIT_FUNC +init__dlgs(void) +{ + Py_InitModule("_dlgs", dlgs_methods); +} + + + +// +// Functions relating to capturing stdout and stderr. +// + +PyObject* _python_stdout(PyObject* self, PyObject* args) +{ + char* text = NULL; + if (!PyArg_ParseTuple(args, "s", &text)) + return NULL; + python_stdout(text); + Py_INCREF(Py_None); + return Py_None; +} + + +PyObject* _python_stderr(PyObject* self, PyObject* args) +{ + char* text = NULL; + if (!PyArg_ParseTuple(args, "s", &text)) + return NULL; + python_stderr(text); + Py_INCREF(Py_None); + return Py_None; +} + + +static PyMethodDef python_stdout_stderr_methods[] = { + {"python_stdout", _python_stdout, METH_VARARGS, ""}, + {"python_stderr", _python_stderr, METH_VARARGS, ""}, + {NULL, NULL, 0, NULL} +}; + + +PyMODINIT_FUNC +init__python_stdout_stderr(void) +{ + Py_InitModule("_python_stdout_stderr", python_stdout_stderr_methods); +} + + + +// +// High level functions. +// + +void start_python_bridge() +{ + Py_Initialize(); + init__main_wdgt(); + init__review_wdgt(); + init__dlgs(); + init__python_stdout_stderr(); + + PyRun_SimpleString( + "import sys\n" + "import _python_stdout_stderr\n" + "class StdoutCatcher:\n" + " def write(self, str):\n" + " _python_stdout_stderr.python_stdout(str)\n" + "class StderrCatcher:\n" + " def write(self, str):\n" + " _python_stdout_stderr.python_stderr(str)\n" + "sys.stdout = StdoutCatcher()\n" + "sys.stderr = StderrCatcher()\n" + ); +} + + + +void stop_python_bridge() +{ + Py_Finalize(); +} + + +void run_python(char* command) +{ + PyRun_SimpleString(command); +} + + +void eval_python_as_unicode(char* expression, char* result, int bufsize) +{ + char buf[256]; + if (strlen(expression) + 26 > sizeof(buf)) + { + printf("Expression too long in eval_as_unicode.\n"); + exit (-1); + }; + snprintf(buf, sizeof(buf), "unicode(%s).encode(\"utf-8\")", expression); + PyObject* main = PyImport_AddModule("__main__"); + PyObject* main_dict = PyModule_GetDict(main); + PyObject* obj = PyRun_String(buf, Py_eval_input, main_dict, main_dict); + PyErr_Print(); + if (obj == NULL) + { + *result = 0; + return; + } + strncpy(result, PyString_AsString(obj), bufsize); + Py_DECREF(obj); +} diff -Nru mnemosyne-2.4/mnemosyne/embedded_in_C/python_bridge.h mnemosyne-2.6+ds/mnemosyne/embedded_in_C/python_bridge.h --- mnemosyne-2.4/mnemosyne/embedded_in_C/python_bridge.h 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/embedded_in_C/python_bridge.h 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,15 @@ +// +// python_bridge.h +// + +void start_python_bridge(); + +void run_python(char* command); + +// Evaluates a Python expression and returns the result as a unicode string +// encoded in utf-8. +// The caller has ownership of the 'result' buffer. +void eval_python_as_unicode(char* expression, char* result, int bufsize); + +void stop_python_bridge(); + diff -Nru mnemosyne-2.4/mnemosyne/embedded_in_C/python_stdout_stderr.c mnemosyne-2.6+ds/mnemosyne/embedded_in_C/python_stdout_stderr.c --- mnemosyne-2.4/mnemosyne/embedded_in_C/python_stdout_stderr.c 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/embedded_in_C/python_stdout_stderr.c 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,16 @@ +// +// python_stdout_stderr.c +// + +#include + +void python_stdout(char* text) +{ + printf("%s", text); +} + + +void python_stderr(char* text) +{ + printf("%s", text); +} diff -Nru mnemosyne-2.4/mnemosyne/embedded_in_C/python_stdout_stderr.h mnemosyne-2.6+ds/mnemosyne/embedded_in_C/python_stdout_stderr.h --- mnemosyne-2.4/mnemosyne/embedded_in_C/python_stdout_stderr.h 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/embedded_in_C/python_stdout_stderr.h 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,7 @@ +// +// python_stdout_stderr.d +// + +void python_stdout(char* text); + +void python_stderr(char* text); diff -Nru mnemosyne-2.4/mnemosyne/embedded_in_C/README mnemosyne-2.6+ds/mnemosyne/embedded_in_C/README --- mnemosyne-2.4/mnemosyne/embedded_in_C/README 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/embedded_in_C/README 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,14 @@ +The files to study when writing a new client based on the embedded C server +are the following: + +example_client.c: shows how to interact with libmnemosyne through C +main_wdgt.c/h, review_wdgt.c/h, dlgs.c/h: these are the functions that + libmnemosyne's UI controllers will call +python_stdout_stderr.c/h: captures stdout and stderr written to + from Python + +Note that Unicode strings are encoded in UTF-8. + +The files above are now implemented in C, but could be implemented in any +language that allows linking to python_bridge.o and libpython.a, e.g. +ObjC. diff -Nru mnemosyne-2.4/mnemosyne/embedded_in_C/review_wdgt.c mnemosyne-2.6+ds/mnemosyne/embedded_in_C/review_wdgt.c --- mnemosyne-2.4/mnemosyne/embedded_in_C/review_wdgt.c 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/embedded_in_C/review_wdgt.c 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,103 @@ +// +// review_wdgt.c +// +// Template, to be replaced by functions which actually do something useful +// in a specific client. +// + +#include + +void review_wdgt_set_question_box_visible(int is_visible) +{ + printf("set_question_box_visible: %d\n", is_visible); +} + + +void review_wdgt_set_answer_box_visible(int is_visible) +{ + printf("set_answer_box_visible: %d\n", is_visible); +} + + +void review_wdgt_set_question_label(char* text) +{ + printf("set_question_label: %s\n", text); +} + + +void review_wdgt_set_question(char* text) +{ + printf("set_question: %s\n", text); +} + + +void review_wdgt_set_answer(char* text) +{ + printf("set_answer: %s\n", text); +} + + +void review_wdgt_clear_question() +{ + printf("clear_question\n"); +} + + +void review_wdgt_clear_answer() +{ + printf("clear_answer\n"); +} + + +void review_wdgt_update_show_button(char* text, int is_default, int is_enabled) +{ + printf("update_show_button: %s %d %d\n", text, is_default, is_enabled); +} + + +void review_wdgt_set_grades_enabled(int is_enabled) +{ + printf("set_grades_enabled: %d\n", is_enabled); +} + + +void review_wdgt_set_grade_enabled(int grade, int is_enabled) +{ + printf("set_grade_enabled: %d %d\n", grade, is_enabled); +} + + +void review_wdgt_set_default_grade(int grade) +{ + printf("set_default_grade: %d\n", grade); +} + + +void review_wdgt_set_grades_title(char* text) +{ + printf("set_grades_title: %s\n", text); +} + + +void review_wdgt_set_grade_text(int grade, char* text) +{ + printf("set_grade_text: %d %s\n", grade, text); +} + + +void review_wdgt_set_grade_tooltip(int grade, char* text) +{ + printf("set_grade_tooltip: %d %s\n", grade, text); +} + + +void review_wdgt_update_status_bar_counters() +{ + printf("update_status_bar_counters\n"); +} + + +void review_wdgt_redraw_now() +{ + printf("redraw_now\n"); +} \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/embedded_in_C/review_wdgt.h mnemosyne-2.6+ds/mnemosyne/embedded_in_C/review_wdgt.h --- mnemosyne-2.4/mnemosyne/embedded_in_C/review_wdgt.h 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/embedded_in_C/review_wdgt.h 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,50 @@ +// +// review_wdgt.h +// + +void review_wdgt_set_question_box_visible(int is_visible); + + +void review_wdgt_set_answer_box_visible(int is_visible); + + +void review_wdgt_set_question_label(char* text); + + +void review_wdgt_set_question(char* text); + + +void review_wdgt_set_answer(char* text); + + +void review_wdgt_clear_question(); + + +void review_wdgt_clear_answer(); + + +void review_wdgt_update_show_button(char* text, int is_default, int is_enabled); + + +void review_wdgt_set_grades_enabled(int is_enabled); + + +void review_wdgt_set_grade_enabled(int grade, int is_enabled); + + +void review_wdgt_set_default_grade(int grade); + + +void review_wdgt_set_grades_title(char* text); + + +void review_wdgt_set_grade_text(int grade, char* text); + + +void review_wdgt_set_grade_tooltip(int grade, char* text); + + +void review_wdgt_update_status_bar_counters(); + + +void review_wdgt_redraw_now(); \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/embedded_in_C/review_wdgt.py mnemosyne-2.6+ds/mnemosyne/embedded_in_C/review_wdgt.py --- mnemosyne-2.4/mnemosyne/embedded_in_C/review_wdgt.py 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/embedded_in_C/review_wdgt.py 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,57 @@ +# +# review_wdgt.py +# + +import _review_wdgt as _ +from mnemosyne.libmnemosyne.ui_components.review_widget import ReviewWidget + + +class ReviewWdgt(ReviewWidget): + + def set_question_box_visible(self, is_visible): + _.set_question_box_visible(is_visible) + + def set_answer_box_visible(self, is_visible): + _.set_answer_box_visible(is_visible) + + def set_question_label(self, text): + _.set_question_label(text.encode("utf-8")) + + def set_question(self, text): + _.set_question(text.encode("utf-8")) + + def set_answer(self, text): + _.set_answer(text.encode("utf-8")) + + def clear_question(self): + _.clear_question() + + def clear_answer(self): + _.clear_answer () + + def update_show_button(self, text, is_default, is_enabled): + _.update_show_button(text.encode("utf-8"), is_default, is_enabled) + + def set_grades_enabled(self, is_enabled): + _.set_grades_enabled(is_enabled) + + def set_grade_enabled(self, grade, is_enabled): + _.set_grade_enabled(is_enabled) + + def set_default_grade(self, grade): + _.set_default_grade(grade) + + def set_grades_title(self, text): + _.set_grades_title(text.encode("utf-8")) + + def set_grade_text(self, grade, text): + _.set_grade_text(grade, text.encode("utf-8")) + + def set_grade_tooltip(self, grade, text): + _.set_grade_tooltip(grade, text.encode("utf-8")) + + def update_status_bar_counters(self): + _.update_status_bar_counters() + + def redraw_now(self): + _.redraw_now() \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/example_plugins/add_menu_item.py mnemosyne-2.6+ds/mnemosyne/example_plugins/add_menu_item.py --- mnemosyne-2.4/mnemosyne/example_plugins/add_menu_item.py 2016-11-28 16:12:36.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/example_plugins/add_menu_item.py 2018-02-07 21:03:52.000000000 +0000 @@ -11,6 +11,7 @@ name = "Hello world" description = "Add a menu item to the help menu" + supported_API_level = 2 def __init__(self, **kwds): super().__init__(**kwds) diff -Nru mnemosyne-2.4/mnemosyne/example_plugins/after_repetition.py mnemosyne-2.6+ds/mnemosyne/example_plugins/after_repetition.py --- mnemosyne-2.4/mnemosyne/example_plugins/after_repetition.py 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/example_plugins/after_repetition.py 2018-02-07 21:03:52.000000000 +0000 @@ -20,7 +20,8 @@ name = "Grade 5 detection" description = "Notice when a card is given grade 5." components = [Grade5DetectionHook] - + supported_API_level = 2 + # Register plugin. diff -Nru mnemosyne-2.4/mnemosyne/example_plugins/avg_grade_statistics.py mnemosyne-2.6+ds/mnemosyne/example_plugins/avg_grade_statistics.py --- mnemosyne-2.4/mnemosyne/example_plugins/avg_grade_statistics.py 2016-06-03 07:22:06.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/example_plugins/avg_grade_statistics.py 2018-02-07 21:03:52.000000000 +0000 @@ -107,6 +107,7 @@ name = "Average grades" description = "Average grade given to scheduled cards as a function of time" components = [AvgGrade, AvgGradeWdgt] + supported_API_level = 2 from mnemosyne.libmnemosyne.plugin import register_user_plugin register_user_plugin(AvgGradePlugin) diff -Nru mnemosyne-2.4/mnemosyne/example_plugins/backup.py mnemosyne-2.6+ds/mnemosyne/example_plugins/backup.py --- mnemosyne-2.4/mnemosyne/example_plugins/backup.py 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/example_plugins/backup.py 2018-02-07 21:03:52.000000000 +0000 @@ -27,6 +27,7 @@ name = "Extra backup" description = "Move your backups to a safe place." components = [BackupHook] + supported_API_level = 2 # Register plugin. diff -Nru mnemosyne-2.4/mnemosyne/example_plugins/configuration.py mnemosyne-2.6+ds/mnemosyne/example_plugins/configuration.py --- mnemosyne-2.4/mnemosyne/example_plugins/configuration.py 2016-11-30 15:41:54.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/example_plugins/configuration.py 2018-02-07 21:03:52.000000000 +0000 @@ -52,6 +52,7 @@ name = "Settings example" description = "Example on how to store settings for your plugin" components = [MyPluginConfiguration, MyConfigurationWdgt] + supported_API_level = 2 def __init__(self, component_manager): Plugin.__init__(self, component_manager) diff -Nru mnemosyne-2.4/mnemosyne/example_plugins/custom_tag.py mnemosyne-2.6+ds/mnemosyne/example_plugins/custom_tag.py --- mnemosyne-2.4/mnemosyne/example_plugins/custom_tag.py 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/example_plugins/custom_tag.py 2018-02-07 21:03:52.000000000 +0000 @@ -49,6 +49,7 @@ name = "Custom tag" description = "Intercepts custom tags like and runs them in an external program.\n\nEdit the source to customise." components = [CustomTag] + supported_API_level = 2 def activate(self): Plugin.activate(self) diff -Nru mnemosyne-2.4/mnemosyne/example_plugins/filter.py mnemosyne-2.6+ds/mnemosyne/example_plugins/filter.py --- mnemosyne-2.4/mnemosyne/example_plugins/filter.py 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/example_plugins/filter.py 2018-02-07 21:03:52.000000000 +0000 @@ -17,7 +17,8 @@ name = "Top align images" description = "Align all your images to the top" components = [AlignImgTop] - + supported_API_level = 2 + def activate(self): Plugin.activate(self) self.render_chain("default").\ diff -Nru mnemosyne-2.4/mnemosyne/example_plugins/grades_criterion.py mnemosyne-2.6+ds/mnemosyne/example_plugins/grades_criterion.py --- mnemosyne-2.4/mnemosyne/example_plugins/grades_criterion.py 2016-11-30 15:48:58.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/example_plugins/grades_criterion.py 2018-02-07 21:03:52.000000000 +0000 @@ -85,6 +85,7 @@ name = "Activity criterion example" description = "Example plugin for grade-based criterion." components = [GradesCriterion, GradesCriterionApplier, GradesCriterionWdgt] + supported_API_level = 2 from mnemosyne.libmnemosyne.plugin import register_user_plugin register_user_plugin(GradesCriterionPlugin) diff -Nru mnemosyne-2.4/mnemosyne/example_plugins/hide_toolbar.py mnemosyne-2.6+ds/mnemosyne/example_plugins/hide_toolbar.py --- mnemosyne-2.4/mnemosyne/example_plugins/hide_toolbar.py 2016-06-03 07:09:58.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/example_plugins/hide_toolbar.py 2018-02-07 21:03:52.000000000 +0000 @@ -11,6 +11,7 @@ name = "Hide toolbar" description = "Hide the main toolbar" + supported_API_level = 2 def __init__(self, component_manager): Plugin.__init__(self, component_manager) diff -Nru mnemosyne-2.4/mnemosyne/example_plugins/html_statistics.py mnemosyne-2.6+ds/mnemosyne/example_plugins/html_statistics.py --- mnemosyne-2.4/mnemosyne/example_plugins/html_statistics.py 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/example_plugins/html_statistics.py 2018-02-07 21:03:52.000000000 +0000 @@ -11,7 +11,7 @@ class MyHtmlStatistics(HtmlStatisticsPage): name = "My html staticsics" - + def prepare_statistics(self, variant): card = self.review_controller().card self.html = """ @@ -34,6 +34,7 @@ name = "Html statistics example" description = "Example plugin for html statistics" components = [MyHtmlStatistics] + supported_API_level = 2 from mnemosyne.libmnemosyne.plugin import register_user_plugin register_user_plugin(MyHtmlStatisticsPlugin) diff -Nru mnemosyne-2.4/mnemosyne/example_plugins/lock_down.py mnemosyne-2.6+ds/mnemosyne/example_plugins/lock_down.py --- mnemosyne-2.4/mnemosyne/example_plugins/lock_down.py 2016-11-30 15:50:59.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/example_plugins/lock_down.py 2018-02-07 21:03:52.000000000 +0000 @@ -11,7 +11,8 @@ name = "Lock down the UI" description = "Hides the menu bar and the icon bar. The only way to remove this plugin later is by deleting 'lock_down.py' from Mnemosyne's plugin directory'" - + supported_API_level = 2 + def activate(self): Plugin.activate(self) self.main_widget().menuBar().hide() diff -Nru mnemosyne-2.4/mnemosyne/example_plugins/new_card_type.py mnemosyne-2.6+ds/mnemosyne/example_plugins/new_card_type.py --- mnemosyne-2.4/mnemosyne/example_plugins/new_card_type.py 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/example_plugins/new_card_type.py 2018-02-07 21:03:52.000000000 +0000 @@ -36,7 +36,8 @@ name = "Decorated vocabulary" description = "Vocabulary card type with some extra text" components = [DecoratedVocabulary] - + supported_API_level = 2 + from mnemosyne.libmnemosyne.plugin import register_user_plugin register_user_plugin(DecoratedVocabularyPlugin) diff -Nru mnemosyne-2.4/mnemosyne/example_plugins/new_card_type_widget.py mnemosyne-2.6+ds/mnemosyne/example_plugins/new_card_type_widget.py --- mnemosyne-2.4/mnemosyne/example_plugins/new_card_type_widget.py 2016-12-01 15:57:57.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/example_plugins/new_card_type_widget.py 2018-02-07 21:03:52.000000000 +0000 @@ -41,6 +41,7 @@ name = "Red" description = "Red widget for front-to-back cards" components = [RedCardTypeWdgt] + supported_API_level = 2 from mnemosyne.libmnemosyne.plugin import register_user_plugin register_user_plugin(RedPlugin) diff -Nru mnemosyne-2.4/mnemosyne/example_plugins/pie_chart_statistics.py mnemosyne-2.6+ds/mnemosyne/example_plugins/pie_chart_statistics.py --- mnemosyne-2.4/mnemosyne/example_plugins/pie_chart_statistics.py 2016-12-01 16:03:26.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/example_plugins/pie_chart_statistics.py 2018-02-07 21:03:52.000000000 +0000 @@ -49,6 +49,7 @@ name = "Pie chart grades" description = "Show the grade statistics in a pie chart" components = [MyGrades, PieChartWdgt] + supported_API_level = 2 from mnemosyne.libmnemosyne.plugin import register_user_plugin register_user_plugin(PieChartPlugin) diff -Nru mnemosyne-2.4/mnemosyne/example_plugins/reverse_arabic.py mnemosyne-2.6+ds/mnemosyne/example_plugins/reverse_arabic.py --- mnemosyne-2.4/mnemosyne/example_plugins/reverse_arabic.py 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/example_plugins/reverse_arabic.py 2018-02-07 21:03:52.000000000 +0000 @@ -22,6 +22,7 @@ name = "Reverse Arabic" description = "Reverse the Arabic in the web server, to compensate for the fact that the Android browser renders Arabic from left to right." components = [ReverseArabic] + supported_API_level = 2 def activate(self): Plugin.activate(self) diff -Nru mnemosyne-2.4/mnemosyne/example_plugins/shortcuts.py mnemosyne-2.6+ds/mnemosyne/example_plugins/shortcuts.py --- mnemosyne-2.4/mnemosyne/example_plugins/shortcuts.py 2016-12-01 16:05:38.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/example_plugins/shortcuts.py 2018-02-07 21:03:52.000000000 +0000 @@ -33,7 +33,7 @@ name = "Custom shortcuts" description = "Customise review widget shortcuts." components = [MyReviewWdgt] - + supported_API_level = 2 # Register plugin. Binary files /tmp/tmpNoYn47/ajGK50spUe/mnemosyne-2.4/mnemosyne/example_scripts/silence.mp3 and /tmp/tmpNoYn47/vW_aZbQ35_/mnemosyne-2.6+ds/mnemosyne/example_scripts/silence.mp3 differ diff -Nru "/tmp/tmpNoYn47/ajGK50spUe/mnemosyne-2.4/mnemosyne/example_scripts/update_modification time.py" "/tmp/tmpNoYn47/vW_aZbQ35_/mnemosyne-2.6+ds/mnemosyne/example_scripts/update_modification time.py" --- "/tmp/tmpNoYn47/ajGK50spUe/mnemosyne-2.4/mnemosyne/example_scripts/update_modification time.py" 2016-06-03 07:22:07.000000000 +0000 +++ "/tmp/tmpNoYn47/vW_aZbQ35_/mnemosyne-2.6+ds/mnemosyne/example_scripts/update_modification time.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -import copy -from mnemosyne.script import Mnemosyne - -from mnemosyne.libmnemosyne.utils import MnemosyneError - -# 'data_dir = None' will use the default system location, edit as appropriate. -data_dir = "C:\dot_test" -mnemosyne = Mnemosyne(data_dir) - -created = {} -modified = {} - -for _card_id, _fact_id in mnemosyne.database().cards(): - card = mnemosyne.database().card(_card_id, is_id_internal=True) - created[card.id] = card.creation_time - modified[card.id] = card.modification_time -mnemosyne.finalise() - -# write - -data_dir = None -mnemosyne = Mnemosyne(data_dir) - -for id in created: - print(id) - mnemosyne.database().con.execute("""update cards set creation_time=?, modification_time=? - where id=?""", (created[id], modified[id], id)) - try: - card = mnemosyne.database().card(id, is_id_internal=False) - mnemosyne.log().edited_card(card) - except MnemosyneError: - pass -mnemosyne.finalise() - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/card.py mnemosyne-2.6+ds/mnemosyne/libmnemosyne/card.py --- mnemosyne-2.4/mnemosyne/libmnemosyne/card.py 2016-06-03 07:22:08.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/card.py 2018-02-07 21:03:52.000000000 +0000 @@ -41,6 +41,11 @@ files, sync, ...), whereas '_id' is an internal id that could be different and that can be used by the database for efficiency reasons. + Card types have been designed so as to require minimal typing when creating + a custom card type, which is why we use class variables. Therefore, when + creating new cards programatically, we need to take care to overwrite the + class variables with instance variables. + """ def __init__(self, card_type, fact, fact_view, creation_time=None): diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/card_type.py mnemosyne-2.6+ds/mnemosyne/libmnemosyne/card_type.py --- mnemosyne-2.4/mnemosyne/libmnemosyne/card_type.py 2015-06-02 15:26:39.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/card_type.py 2018-02-07 21:03:52.000000000 +0000 @@ -45,6 +45,7 @@ id = "-1" name = "" component_type = "card_type" + hidden_from_UI = False fact_keys_and_names = None fact_views = None diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/card_types/cloze.py mnemosyne-2.6+ds/mnemosyne/libmnemosyne/card_types/cloze.py --- mnemosyne-2.4/mnemosyne/libmnemosyne/card_types/cloze.py 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/card_types/cloze.py 2018-02-07 21:03:52.000000000 +0000 @@ -170,3 +170,4 @@ Editing the text will automatically update all sister cards.\n\nYou can also specify hints, e.g. [cloze:hint] will show [hint] in the question as opposed to [...].""") components = [Cloze] + supported_API_level = 2 diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/card_types/map.py mnemosyne-2.6+ds/mnemosyne/libmnemosyne/card_types/map.py --- mnemosyne-2.4/mnemosyne/libmnemosyne/card_types/map.py 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/card_types/map.py 2018-02-07 21:03:52.000000000 +0000 @@ -52,3 +52,4 @@ description = _("""A card type for learning locations on a map.\n Displays the answer map on top of the question map, rather than below it as a second map.""") components = [Map] + supported_API_level = 2 \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/card_types/M_sided.py mnemosyne-2.6+ds/mnemosyne/libmnemosyne/card_types/M_sided.py --- mnemosyne-2.4/mnemosyne/libmnemosyne/card_types/M_sided.py 1970-01-01 00:00:00.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/card_types/M_sided.py 2018-02-07 21:03:52.000000000 +0000 @@ -0,0 +1,66 @@ +# +# M_sided.py +# + +import os +import sys +import copy + +from mnemosyne.libmnemosyne.translator import _ +from mnemosyne.libmnemosyne.plugin import Plugin +from mnemosyne.libmnemosyne.card_type import CardType +from mnemosyne.libmnemosyne.filters.escape_to_html import EscapeToHtml + + +class MSided(CardType): + + """Abstract parent class for M-sided card types with Anki syntax.""" + + id = "7" + name = _("M-sided") + hidden_from_UI = True + + # Need to be overwritten with correct instance variables at creation. + fact_keys_and_names = [] + fact_views = [] + unique_fact_keys = [] + required_fact_keys = [] + + def __init__(self, component_manager): + super().__init__(component_manager) + # Add Anki files to Python path. + path = os.path.join(os.path.dirname(sys.modules['mnemosyne'].__file__), + "libmnemosyne", "renderers") + if path not in sys.path: + sys.path.append(path) + from mnemosyne.libmnemosyne.renderers.anki_renderer import AnkiRenderer + self.renderer = AnkiRenderer(component_manager) + + def render_question(self, card, render_chain="default", **render_args): + return self._render(card, render_chain, render_QA="Q", **render_args) + + def render_answer(self, card, render_chain="default", **render_args): + # If we cannot isolate the question from the answer, and we need + # the 'FrontSide' info, calculate this info first. + if self.config()["QA_split"] == "single_window" or \ + "
" not in card.fact_view.extra_data["afmt"]: + if "FrontSide" in card.fact_view.extra_data["afmt"]: + new_render_args = copy.copy(render_args) + new_render_args["body_only"] = True + render_args["FrontSide"] = \ + self.render_question(card, render_chain, **new_render_args) + return self._render(card, render_chain, render_QA="A", **render_args) + + def _render(self, card, render_chain="default", **render_args): + # Because there is no list of fact keys for q or a for this card type, + # we need to run the filters after assembling the content, not before. + html = self.renderer.render(\ + card, card.fact.data, render_chain, **render_args) + if "body_only" in render_args and render_args["body_only"] == True: + return html # Filters will be run later. + for filter in self.render_chain(render_chain)._filters: + # EscapeToHtml introduces
inside css. + if filter.__class__ != EscapeToHtml: + html = filter.run(html, card, fact_key=None, **render_args) + return html + diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/card_types/sentence.py mnemosyne-2.6+ds/mnemosyne/libmnemosyne/card_types/sentence.py --- mnemosyne-2.4/mnemosyne/libmnemosyne/card_types/sentence.py 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/card_types/sentence.py 2018-02-07 21:03:52.000000000 +0000 @@ -95,3 +95,4 @@ description = _("""A card type using sentences to study foreign languages.\n Apart from simple recognition of the sentence, you can also add production cards using close deletion.\nE.g. if in the sentence field you write "La [casa:house] es [grande:big]", you'll get cards with questions like "La [house] es grande".""") components = [Sentence] + supported_API_level = 2 \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/component_manager.py mnemosyne-2.6+ds/mnemosyne/libmnemosyne/component_manager.py --- mnemosyne-2.4/mnemosyne/libmnemosyne/component_manager.py 2016-11-28 15:54:54.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/component_manager.py 2018-02-07 21:03:52.000000000 +0000 @@ -13,15 +13,15 @@ For certain components, many can be active at the same time (card types, filters, function hooks, ...). For others, there can be only on active at the same time, like schedule, database ... The idea is that the last - one registered takes preference. This means that e.g. the default - scheduler needs to be registered first. + one registered takes preference. """ def __init__(self): self.components = {} # {used_for: {type: [component]} } self.card_type_with_id = {} - self.render_chain_by_id = {} + self.render_chain_with_id = {} + self.study_mode_with_id = {} self.debug_file = None def register(self, component): @@ -39,7 +39,9 @@ if comp_type == "card_type": self.card_type_with_id[component.id] = component elif comp_type == "render_chain": - self.render_chain_by_id[component.id] = component + self.render_chain_with_id[component.id] = component + elif comp_type == "study_mode": + self.study_mode_with_id[component.id] = component def unregister(self, component): comp_type = component.component_type @@ -48,9 +50,9 @@ if component.component_type == "card_type": del self.card_type_with_id[component.id] elif component.component_type == "render_chain": - del self.render_chain_by_id[component.id] + del self.render_chain_with_id[component.id] - def add_component_to_plugin(self, plugin_class_name, component_class): + def add_gui_to_component(self, component_name, gui_component): """Typical use case for this is when a plugin has a GUI component which obviously does not live inside libmnemosyne, and which needs to @@ -58,9 +60,11 @@ """ - for plugin in self.all("plugin"): - if plugin.__class__.__name__ == plugin_class_name: - plugin.components.append(component_class) + for used_for in self.components: + for component_type in self.components[used_for]: + for component in self.components[used_for][component_type]: + if component.__class__.__name__ == component_name: + component.gui_components.append(gui_component) def all(self, comp_type, used_for=None): @@ -126,7 +130,7 @@ if not isinstance(component, type): component.deactivate() # Following line deactivated to work around - # https://bugreports.qt.io/browse/QTBUG-52988 + # https://bugreports.qt.io/browse/QTBUG-52988 #self.components = {} self.card_type_with_id = {} @@ -139,6 +143,7 @@ if self.debug_file: self.debug_file.write(str(msg + "\n").encode('UTF-8')) + # A component manager stores the entire session state of a user through the # different components it registers. To enable multiple users to use a single # instance of libmnemosyne simultaneously, we store a component manager diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/component.py mnemosyne-2.6+ds/mnemosyne/libmnemosyne/component.py --- mnemosyne-2.4/mnemosyne/libmnemosyne/component.py 2016-07-06 07:40:49.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/component.py 2018-02-07 21:03:52.000000000 +0000 @@ -12,7 +12,7 @@ generic_card_type_widget, ui_component, controller, main_widget, review_controller, review_widget, file format, plugin, hook, criterion, criterion_applier, statistics_page, sync_server, - all the abstract dialogs, ... + study_mode, all the abstract dialogs, ... 'used_for' can store certain relationships between components, e.g. a card type widget is used for a certain card type. @@ -22,9 +22,15 @@ time on a mobile device, and should be done lazily.) Only the main widget is stored as an instance here. - When 'instantiate == LATER', the component is lazily created when needed. + To achieve this lazy instantiation for widget, set 'instantiate == LATER'. + Other components can then instantiate the widget when they see fit. The instance is not cached for subsequent reuse, as these widgets typically can become obsolete/overwritten by plugins. + + It can be that when instantiating a component, not all the other components + on which it relies have been instantiated yet. E.g., the log and the + database depend on each other before doing actual work. Therefore, some of + the actual initialisation work can be postponed to the 'activate' function. Each component has access to all of the context of the other components because it hold a reference to the user's component manager. @@ -33,6 +39,9 @@ constructor, as many component make use of it in their __init__ method. This means that derived components should always call the Component.__init__ if they provide their own constructor. + + In case the GUI needs to add functionality to a certain component, that + can be done through component_manager.add_gui_to_component(). """ @@ -45,21 +54,33 @@ instantiate = IMMEDIATELY def __init__(self, component_manager, **kwds): - super().__init__(**kwds) + super().__init__(**kwds) # For parent classes other than 'Object'. self.component_manager = component_manager + self.gui_components = [] + self.instantiated_gui_components = [] def activate(self): """Initialisation code called when the component is about to do actual work, and which can't happen in the constructor, e.g. because components on which it relies have not yet been registered. + + GUI classes are only instantiated when activated, since that can take + a lot of time on mobile clients. """ - pass + for component in self.gui_components: + component = component(component_manager=self.component_manager) + self.component_manager.register(component) + component.activate() + self.instantiated_gui_components.append(component) def deactivate(self): - pass + for component in self.instantiated_gui_components: + component.deactivate() + self.component_manager.unregister(component) + self.instantiated_gui_components = [] # Convenience functions, for easier access to all of the context of # libmnemosyne from within a component. @@ -89,15 +110,7 @@ return self.component_manager.current("main_widget") def review_widget(self): - - """Apart from the main widget, we create all other widgets lazily for - efficiency reasons. The review widget instance is therefore not stored - in the component manager, but is under the control of the review - controller. - - """ - - return self.review_controller().widget + return self.component_manager.current("review_widget") def controller(self): return self.component_manager.current("controller") @@ -112,14 +125,14 @@ return self.component_manager.card_type_with_id[id] def render_chain(self, id="default"): - return self.component_manager.render_chain_by_id[id] - + return self.component_manager.render_chain_with_id[id] + + def study_mode_with_id(self, id): + return self.component_manager.study_mode_with_id[id] + def plugins(self): return self.component_manager.all("plugin") - def start_review(self): - self.review_controller().reset() - def flush_sync_server(self): """If there are still dangling sessions (i.e. those waiting in vain diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/configuration.py mnemosyne-2.6+ds/mnemosyne/libmnemosyne/configuration.py --- mnemosyne-2.4/mnemosyne/libmnemosyne/configuration.py 2016-11-11 15:53:26.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/configuration.py 2018-02-07 21:03:52.000000000 +0000 @@ -7,6 +7,7 @@ import sys import time import sqlite3 +import threading import importlib from mnemosyne.libmnemosyne.translator import _ @@ -40,7 +41,7 @@ show_tags_during_review = True # The number of daily backups to keep. Set to -1 for no limit. -backups_to_keep = 10 +max_backups = 10 # Start the card browser with the last used colum sort. Can have a serious # performance penalty for large databases. @@ -72,10 +73,6 @@ # Latex dvipng command. dvipng = "dvipng -D 200 -T tight tmp.dvi" - -# Try to optimise height of Q and A window to show maximum amount of relevant -# information -optimise_Q_A_split = True """ class Configuration(Component, dict): @@ -87,9 +84,12 @@ self.data_dir = None self.config_dir = None self.keys_to_sync = [] + self.server_only = False + self.lock = threading.Lock() self.determine_dirs() - + def activate(self): + Component.activate(self) self.fill_dirs() self.load() self.load_user_config() @@ -127,12 +127,13 @@ "randomise_new_cards": False, "randomise_scheduled_cards": False, "cramming_store_state": True, + "max_ret_reps_for_recent_cards": 1, "cramming_order": RANDOM, "show_intervals": "never", "only_editable_when_answer_shown": False, "show_tags_during_review": True, "ui_language": "en", - "backups_to_keep": 10, + "max_backups": 10, "backup_before_sync": True, "check_for_edited_local_media_files": False, "interested_in_old_reps": True, @@ -148,8 +149,7 @@ "latex_postamble": "\\end{document}", "latex": "latex -interaction=nonstopmode", "dvipng": "dvipng -D 200 -T tight tmp.dvi", - "optimise_Q_A_split": True, - "active_plugins": set(), # Plugin classes, not instances. + "active_plugins": set(), # Plugin class name, not instance. "media_autoplay": True, "media_controls": False, "run_sync_server": False, @@ -170,7 +170,9 @@ "import_extra_tag_names": "", "export_dir": os.path.expanduser("~"), "export_format": None, - "last_db_maintenance": time.time() - 91 * DAY + "last_db_maintenance": time.time() - 1 * DAY, + "QA_split": "fixed", # "fixed", "adaptive", "single_window", + "study_mode": "ScheduledForgottenNew" }.items()): self.setdefault(key, value) # These keys will be shared in the sync protocol. Front-ends can @@ -180,7 +182,7 @@ "hide_pronunciation_field", "non_memorised_cards_in_hand", "randomise_new_cards", "randomise_scheduled_cards", "ui_language", "day_starts_at", "latex_preamble", - "latex_postamble", "latex", "dvipng"] + "latex_postamble", "latex", "dvipng", "max_backups"] # If the user id is not set, it's either because this is the first run # of the program, or because the user deleted the config file. In the # latter case, we try to recuperate the id from the history files. @@ -191,31 +193,36 @@ self["user_id"] = rand_uuid() else: self["user_id"] = history_files[0].split("_", 1)[0] + self["latex"] = self["latex"].strip().split() + self["dvipng"] = self["dvipng"].strip().split() # Allow other plugins or frontend to set their configuration data. for f in self.component_manager.all("hook", "configuration_defaults"): f.run() self.save() def __setitem__(self, key, value): - if key in self.keys_to_sync: - # Don't log when reading the settings from file during startup. - if self.log().active: - self.log().edited_setting(key) - dict.__setitem__(self, key, value) + with self.lock: + if key in self.keys_to_sync: + # Don't log when reading the settings from file during startup. + if self.log().active: + self.log().edited_setting(key) + dict.__setitem__(self, key, value) def load(self): filename = os.path.join(self.config_dir, "config.db") - con = sqlite3.connect(filename) # Create database tables if needed. - is_new = (con.execute("""select count() from sqlite_master where - type='table' and name='config';""").fetchone()[0] == 0) - if is_new: - con.executescript(""" - create table config( - key text primary key, - value text - );""") - con.commit() + with self.lock: + con = sqlite3.connect(filename) + is_new = (con.execute("""select 1 from sqlite_master where + type='table' and name='config' limit 1;""").\ + fetchone() is None) + if is_new: + con.executescript(""" + create table config( + key text primary key, + value text + );""") + con.commit() # Quick-and-dirty system to allow us to instantiate GUI variables # from the config db. The alternatives (e.g. having the frontend pass # along modules to import) seem to be much more verbose and quirky. @@ -223,32 +230,40 @@ import PyQt5 except: pass + try: + import PyQt5.QtCore + except: + pass # Set config settings. for cursor in con.execute("select key, value from config"): # When importing Python 2 representations, strip the L # from long integers. - value = re_long_int.sub(lambda x : x.group()[:-1], cursor[1]) + value = re_long_int.sub(lambda x : x.group()[:-1], cursor[1]) try: self[cursor[0]] = eval(value) - except: + except Exception as e: # This can fail if we are running headless now after running # the GUI previously. - pass - con.close() + print(e) + with self.lock: + con.commit() + con.close() def save(self): - filename = os.path.join(self.config_dir, "config.db") - con = sqlite3.connect(filename) - # Make sure the entries exist. - con.executemany("insert or ignore into config(key, value) values(?,?)", - ((key, repr(value)) for key, value in self.items())) - # Make sure they have the right data. - con.executemany("update config set value=? where key=?", - ((repr(value), key) for key, value in self.items())) - con.commit() - con.close() + with self.lock: + filename = os.path.join(self.config_dir, "config.db") + con = sqlite3.connect(filename) + # Make sure the entries exist. + con.executemany\ + ("insert or ignore into config(key, value) values(?,?)", + ((key, repr(value)) for key, value in self.items())) + # Make sure they have the right data. + con.executemany("update config set value=? where key=?", + ((repr(value), key) for key, value in self.items())) + con.commit() + con.close() - def determine_dirs(self): # pragma: no cover + def determine_dirs(self): # pragma: no cover # If the config dir was already set by the user, use that. if self.config_dir is not None: return @@ -390,7 +405,8 @@ readline().rstrip() def load_user_config(self): - sys.path.insert(0, self.config_dir) + if self.config_dir not in sys.path: + sys.path.insert(0, self.config_dir) config_file_c = os.path.join(self.config_dir, "config.pyc") if os.path.exists(config_file_c): os.remove(config_file_c) diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/controller.py mnemosyne-2.6+ds/mnemosyne/libmnemosyne/controller.py --- mnemosyne-2.4/mnemosyne/libmnemosyne/controller.py 2014-10-29 13:31:32.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/controller.py 2018-02-07 21:03:52.000000000 +0000 @@ -33,6 +33,9 @@ def show_add_cards_dialog(self): raise NotImplementedError + + def set_study_mode(self, study_mode): + raise NotImplementedError def create_new_cards(self, fact_data, card_type, grade, tag_names, check_for_duplicates=True, save=True): diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/controllers/default_controller.py mnemosyne-2.6+ds/mnemosyne/libmnemosyne/controllers/default_controller.py --- mnemosyne-2.4/mnemosyne/libmnemosyne/controllers/default_controller.py 2016-11-22 15:20:35.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/controllers/default_controller.py 2018-02-07 21:03:52.000000000 +0000 @@ -6,7 +6,6 @@ import sys import copy import time -import shutil from mnemosyne.libmnemosyne.fact import Fact from mnemosyne.libmnemosyne.translator import _ @@ -34,10 +33,11 @@ """ def activate(self): + self.study_mode = None Controller.activate(self) self.next_rollover = self.database().start_of_day_n_days_ago(n=-1) - def heartbeat(self): + def heartbeat(self, db_maintenance=True): """Making sure, even if the user leaves the program open indefinitely, that backups get taken, that the cards scheduled for the day get dumped @@ -47,24 +47,39 @@ """ if time.time() > self.next_rollover: - self.flush_sync_server() - if not self.database().is_loaded() or \ - not self.database().is_accessible(): - # Make sure we don't continue if e.g. the GUI or another thread - # holds the database - return - self.database().backup() - self.log().saved_database() - self.log().loaded_database() - self.log().future_schedule() - self.log().dump_to_science_log() - self.log().deactivate() - self.log().activate() - self.config().save() - self.review_controller().reset() + if self.config().server_only: + self.database().backup() + self.log().dump_to_science_log() + else: + self.flush_sync_server() + if not self.database() or not self.database().is_loaded() or \ + not self.database().is_accessible(): + # Make sure we don't continue if e.g. the GUI or another + # thread holds the database. + return + self.database().backup() + self.log().saved_database() + self.log().loaded_database() + self.log().future_schedule() + self.log().dump_to_science_log() + self.log().deactivate() + self.log().activate() + self.config().save() + self.reset_study_mode() self.next_rollover = self.database().start_of_day_n_days_ago(n=-1) - if time.time() > self.config()["last_db_maintenance"] + 90 * DAY: - self.component_manager.current("database_maintenance").run() + if db_maintenance and \ + (time.time() > self.config()["last_db_maintenance"] + 90 * DAY): + self.component_manager.current("database_maintenance").run() + self.config()["last_db_maintenance"] = time.time() + self.config().save() + + def do_db_maintenance(self): + if time.time() < self.config()["last_db_maintenance"] + 30 * DAY: + self.main_widget().show_information(\ + _("No need to do database maintenance more than once per month.")) + return + else: + self.component_manager.current("database_maintenance").run() self.config()["last_db_maintenance"] = time.time() self.config().save() @@ -80,6 +95,19 @@ title += " - " + db.current_criterion().name self.main_widget().set_window_title(title) + def set_study_mode(self, study_mode): + if self.study_mode == study_mode: + return + if self.study_mode is not None: + self.study_mode.deactivate() + study_mode.activate() + self.study_mode = study_mode + self.config()["study_mode"] = study_mode.id + + def reset_study_mode(self): + self.study_mode.deactivate() + self.study_mode.activate() + def show_add_cards_dialog(self): self.stopwatch().pause() self.flush_sync_server() @@ -175,7 +203,7 @@ card.fact.data = merged_fact_data card.tags = tags self.component_manager.current("edit_card_dialog")\ - (card, component_manager=self.component_manager, + (card, component_manager=self.component_manager, allow_cancel=False).activate() return db.cards_from_fact(fact) # Create cards. @@ -191,17 +219,17 @@ if save: db.save() if self.review_controller().learning_ahead == True: - self.review_controller().reset() + self.reset_study_mode() return cards - def show_edit_card_dialog(self): + def show_edit_card_dialog(self): self.stopwatch().pause() self.flush_sync_server() review_controller = self.review_controller() # This dialog calls 'edit_card_and_sisters' at some point. state = review_controller.state() accepted = self.component_manager.current("edit_card_dialog")\ - (review_controller.card, + (review_controller.card, component_manager=self.component_manager).activate() if not accepted: self.stopwatch().unpause() @@ -228,7 +256,7 @@ """This is an internal function, used by 'edit_card_and_sisters' and 'change_card_type'. It should not be called from the outside by itself, otherwise the database will not be saved. - + Returns -2 for error, -1 for cancel and 0 for success. """ @@ -240,7 +268,7 @@ assert cards_from_fact[0].card_type == old_card_type if not new_card_type.is_fact_data_valid(new_fact_data): self.main_widget().show_error(\ - _("Card data not correctly formatted for conversion.\n\nSkipping ") +\ + _("Card data not correctly formatted for conversion.\n\nSkipping ") +\ "|".join(list(fact.data.values())) + ".\n") return -2 converter = self.component_manager.current\ @@ -320,7 +348,7 @@ for card in edited_cards: db.update_card(card) if new_cards and self.review_controller().learning_ahead: - self.review_controller().reset() + self.reset_study_mode() return 0 def edit_card_and_sisters(self, card, new_fact_data, new_card_type, @@ -334,7 +362,7 @@ fact = db.fact(card.fact._id, is_id_internal=True) current_sister_cards = self.database().cards_from_fact(fact) current_tag_strings = set([sister_card.tag_string() \ - for sister_card in current_sister_cards]) + for sister_card in current_sister_cards]) # Change the card type if needed. This does not take into account # changes to fact yet, which will come just afterwards. result = self._change_card_type(card.fact, card.card_type, @@ -360,7 +388,7 @@ for edited_card in edited_cards: db.update_card(edited_card) if new_cards and self.review_controller().learning_ahead == True: - self.review_controller().reset() + self.reset_study_mode() # Apply new tags and modification time to cards and save them back to # the database. Note that this makes sure there is an EDITED_CARD log # entry for each sister card, which is needed when syncing with a @@ -368,7 +396,7 @@ tag_for_current_card_only = False if len(current_tag_strings) > 1: tag_for_current_card_only = bool(self.main_widget().show_question( - _("This card has different tags than its sister cards. Update tags for current card only or for all sister cards?"), +_("This card has different tags than its sister cards. Update tags for current card only or for all sister cards?"), _("Current card only"), _("All sister cards"), "") == 0) old_tags = set() tags = db.get_or_create_tags_with_names(new_tag_names) @@ -404,14 +432,14 @@ if new_card_type.is_fact_data_valid(new_fact_data): fact.data = new_fact_data else: - new_fact_data = copy.copy(fact.data) + new_fact_data = copy.copy(fact.data) result = self._change_card_type(fact, old_card_type, new_card_type, correspondence, new_fact_data, warn) if result == -1: # Cancel. w.close_progress() - return - if correspondence and result != -2: # Error. - db.update_fact(fact) + return + if correspondence and result != -2: # Error. + db.update_fact(fact) warn = False w.increase_progress(1) db.save() @@ -423,7 +451,7 @@ if self.config()["star_help_shown"] == False: self.main_widget().show_information(\ _("This will add a tag 'Starred' to the current card, so that you can find it back easily, e.g. to edit it on a desktop.")) - self.config()["star_help_shown"] = True + self.config()["star_help_shown"] = True db = self.database() review_controller = self.review_controller() tag = db.get_or_create_tag_with_name(_("Starred")) @@ -576,7 +604,7 @@ self.main_widget().close_progress() db.load(self.config()["last_database"]) self.log().loaded_database() - self.review_controller().reset() + self.reset_study_mode() self.review_controller().update_dialog() self.update_title() self.stopwatch().unpause() @@ -612,7 +640,7 @@ # case, as the user wants to throw it away. This mainly # prohibits dumping to the science log. db.restore(filename) - self.review_controller().reset() + self.reset_study_mode() self.update_title() self.stopwatch().unpause() return @@ -635,7 +663,7 @@ db.load(old_path) self.stopwatch().unpause() return - self.review_controller().reset() + self.reset_study_mode() self.update_title() self.stopwatch().unpause() @@ -672,7 +700,7 @@ self.main_widget().show_information(\ _("The configuration database cannot be used to store cards.")) self.stopwatch().unpause() - return + return if not filename.endswith(suffix): filename += suffix try: @@ -680,6 +708,7 @@ new_media_dir = self.database().media_dir() if old_media_dir == new_media_dir: return + import shutil if os.path.exists(new_media_dir): shutil.rmtree(new_media_dir) shutil.copytree(old_media_dir, new_media_dir) @@ -698,8 +727,8 @@ self.component_manager.current("compact_database_dialog")\ (component_manager=self.component_manager).activate() self.review_controller().reset_but_try_to_keep_current_card() - self.stopwatch().unpause() - + self.stopwatch().unpause() + def show_insert_img_dialog(self, filter): """Show a file dialog filtered on the supported filetypes, get a @@ -785,14 +814,14 @@ def show_activate_cards_dialog(self): self.show_activate_cards_dialog_pre() self.show_activate_cards_dialog_post() - + def show_activate_cards_dialog_pre(self): self.stopwatch().pause() self.flush_sync_server() self.component_manager.current("activate_cards_dialog")\ (component_manager=self.component_manager).activate() - - def show_activate_cards_dialog_post(self): + + def show_activate_cards_dialog_post(self): review_controller = self.review_controller() review_controller.reset_but_try_to_keep_current_card() review_controller.update_status_bar_counters() @@ -941,30 +970,17 @@ (component_manager=self.component_manager).activate() self.stopwatch().unpause() - def show_export_metadata_dialog(self, metadata=None, read_only=False): - self.stopwatch().pause() - self.flush_sync_server() - dialog = self.component_manager.current("export_metadata_dialog")\ - (component_manager=self.component_manager) - if metadata: - dialog.set_values(metadata) - if read_only: - dialog.set_read_only() - dialog.activate() - self.stopwatch().unpause() - return dialog.values() - def show_sync_dialog(self): self.show_sync_dialog_pre() self.show_sync_dialog_post() - - def show_sync_dialog_pre(self): + + def show_sync_dialog_pre(self): self.stopwatch().pause() self.flush_sync_server() self.database().save() self.component_manager.current("sync_dialog")\ - (component_manager=self.component_manager).activate() - + (component_manager=self.component_manager).activate() + def show_sync_dialog_post(self): self.database().save() self.log().saved_database() @@ -989,7 +1005,7 @@ self.database().store_pregenerated_data client.do_backup = self.config()["backup_before_sync"] client.upload_science_logs = self.config()["upload_science_logs"] - try: + try: client.sync(server, port, username, password) finally: client.database.release_connection() diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/database.py mnemosyne-2.6+ds/mnemosyne/libmnemosyne/database.py --- mnemosyne-2.4/mnemosyne/libmnemosyne/database.py 2016-01-29 15:55:52.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/database.py 2018-02-07 21:03:52.000000000 +0000 @@ -24,6 +24,7 @@ component_type = "database" def deactivate(self): + Component.deactivate(self) self.unload() def path(self): @@ -285,18 +286,33 @@ def cards_learn_ahead(self, now, sort_key="", limit=-1): raise NotImplementedError + + def recently_memorised_count(self, max_ret_reps): + raise NotImplementedError - # Extra commands for custom schedulers. + # Extra queries for custom schedulers. def set_scheduler_data(self, scheduler_data): raise NotImplementedError - def cards_with_scheduler_data(self, scheduler_data, sort_key="", limit=-1): + def cards_with_scheduler_data(self, scheduler_data, sort_key="", limit=-1, + max_ret_reps=-1): raise NotImplementedError - def scheduler_data_count(self, scheduler_data): + def scheduler_data_count(self, scheduler_data, max_ret_reps=-1): raise NotImplementedError - + + # + # Extra queries for language analysis. + # + + def known_recognition_questions_count_from_card_types_ids(\ + self, card_type_ids): + raise NotImplementedError + + def known_recognition_questions_from_card_types_ids(self, card_type_ids): + raise NotImplementedError + def sorted_card_types(self): """Sorts card types so that all the built-in card types appear first, diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/databases/SQLite_logging.py mnemosyne-2.6+ds/mnemosyne/libmnemosyne/databases/SQLite_logging.py --- mnemosyne-2.4/mnemosyne/libmnemosyne/databases/SQLite_logging.py 2016-07-25 07:51:54.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/databases/SQLite_logging.py 2018-02-07 21:03:52.000000000 +0000 @@ -224,7 +224,8 @@ for cursor in self.con.execute("""select _id, event_type, timestamp, object_id, grade, easiness, acq_reps, ret_reps, lapses, acq_reps_since_lapse, ret_reps_since_lapse, scheduled_interval, - actual_interval, thinking_time, next_rep from log where _id>?""", (last_index, )): + actual_interval, thinking_time, next_rep from log where _id>?""", + (last_index, )): index = int(cursor[0]) event_type = cursor[1] timestamp = time.strftime("%Y-%m-%d %H:%M:%S", @@ -400,7 +401,10 @@ drop index i_log_object_id;""") arch_con.commit() arch_con.close() - # Transfer old logs. + # Needed for Android. + self.con.execute("PRAGMA temp_store_directory='%s';" % \ + (archive_dir, )) + # Transfer old logs. script = string.Template(""" attach "$archive_path" as archive; begin; @@ -421,4 +425,5 @@ """).substitute(archive_path=archive_path, one_year_ago=one_year_ago) self.con.executescript(script) self.main_widget().close_progress() - \ No newline at end of file + + \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/databases/SQLite_media.py mnemosyne-2.6+ds/mnemosyne/libmnemosyne/databases/SQLite_media.py --- mnemosyne-2.4/mnemosyne/libmnemosyne/databases/SQLite_media.py 2016-08-04 14:57:11.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/databases/SQLite_media.py 2018-02-07 21:03:52.000000000 +0000 @@ -10,6 +10,7 @@ from md5 import md5 from mnemosyne.libmnemosyne.translator import _ +from mnemosyne.libmnemosyne.utils import normalise_path from mnemosyne.libmnemosyne.utils import expand_path, contract_path from mnemosyne.libmnemosyne.utils import is_filesystem_case_insensitive from mnemosyne.libmnemosyne.utils import copy_file_to_dir, remove_empty_dirs_in @@ -38,7 +39,7 @@ if not os.path.exists(media_dir): try: os.makedirs(media_dir) - except WindowsError: + except OSError: self.main_widget().show_error(_("Could not create" ) + " " + \ media_dir + ".\n" + _("Check your file permissions and make sure the directory is not open in a file browser.")) @@ -60,18 +61,10 @@ """ - filename = os.path.join(self.media_dir(), os.path.normcase(filename)) + filename = normalise_path(os.path.join(self.media_dir(), filename)) if not os.path.exists(filename): return "0" - media_file = open(filename, "rb") - - #try: - # media_file = file(filename, "rb") - #except UnicodeEncodeError: # Android specific issue. - # media_file = file(filename.encode("utf-8"), "rb") - - hasher = md5() while True: buffer = media_file.read(8096) @@ -89,7 +82,7 @@ # Regular media files. new_hashes = {} for sql_res in self.con.execute("select filename, _hash from media"): - filename, hash = sql_res[0], sql_res[1] + filename, hash = normalise_path(sql_res[0]), sql_res[1] if not os.path.exists(expand_path(filename, self.media_dir())): continue new_hash = self._media_hash(filename) @@ -153,7 +146,8 @@ _("Filename contains '#', which could cause problems on some operating systems.")) if not os.path.exists(filename) and \ not os.path.exists(expand_path(filename, self.media_dir())): - self.main_widget().show_error(_("Missing media file!") + "\n\n" + filename) + self.main_widget().show_error(\ + _("Missing media file!") + "\n\n" + filename) for fact_key, value in fact.data.items(): fact.data[fact_key] = \ fact.data[fact_key].replace(match.group(), @@ -171,8 +165,8 @@ self.con.execute("""update data_for_fact set value=? where _fact_id=? and key=?""", (fact.data[fact_key], fact._id, fact_key)) - if self.con.execute("select count() from media where filename=?", - (filename, )).fetchone()[0] == 0: + if self.con.execute("select 1 from media where filename=? limit 1", + (filename, )).fetchone() is None: self.con.execute("""insert into media(filename, _hash) values(?,?)""", (filename, self._media_hash(filename))) # When we are applying log entries during sync or import, the diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/databases/SQLite.py mnemosyne-2.6+ds/mnemosyne/libmnemosyne/databases/SQLite.py --- mnemosyne-2.4/mnemosyne/libmnemosyne/databases/SQLite.py 2016-08-29 09:52:53.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/databases/SQLite.py 2018-02-07 21:03:52.000000000 +0000 @@ -6,7 +6,6 @@ import sys import time import string -import shutil import datetime import copy as objcopy @@ -23,7 +22,6 @@ from mnemosyne.libmnemosyne.utils import expand_path, contract_path from mnemosyne.libmnemosyne.utils import numeric_string_cmp_key, mangle - # All ids beginning with an underscore refer to primary keys in the SQL # database. All other id's correspond to the id's used in libmnemosyne. # For large tables, we don't use libmnemosyne id's as primary keys for @@ -206,6 +204,7 @@ from mnemosyne.libmnemosyne.databases.SQLite_logging import SQLiteLogging from mnemosyne.libmnemosyne.databases.SQLite_statistics import SQLiteStatistics + class SQLite(Database, SQLiteSync, SQLiteMedia, SQLiteLogging, SQLiteStatistics): @@ -221,7 +220,7 @@ """ - version = "2" + version = "4" suffix = ".db" store_pregenerated_data = True @@ -272,9 +271,9 @@ def path(self): return self._path - + def data_dir(self): - return os.path.dirname(self._path) + return os.path.dirname(self._path) def name(self): return os.path.basename(self._path) @@ -290,7 +289,7 @@ self.main_widget().set_progress_text(_("Defragmenting database...")) self.con.execute("vacuum") # Make sure the "Untagged" tag does not show up together with - # different tags. + # different tags (not sure if bug causing this has been fixed). untagged = self.tag("__UNTAGGED__", is_id_internal=False) for cursor in self.con.execute("select _id from cards"): _card_id = cursor[0] @@ -301,6 +300,9 @@ self.con.execute(\ "delete from tags_for_card where _card_id=? and _tag_id=?", (_card_id, untagged._id)) + # Make sure no orphaned card tags exist (not sure if bug causing + # this has been fixed). + self.con.execute("delete from tags_for_card where _card_id is null") self.main_widget().close_progress() def new(self, path): @@ -335,6 +337,7 @@ self._current_criterion.name = self.default_criterion_name self._current_criterion._tag_ids_active.add(tag._id) self.add_criterion(self._current_criterion) + self.save() def load(self, path): if self.is_loaded(): @@ -379,7 +382,7 @@ defined_in_database_ids = [cursor[0] for cursor in \ self.con.execute("select id from card_types")] for id in used_ids + defined_in_database_ids: - self.activate_plugins_for_card_type_with_id(id) + self.activate_plugins_for_card_type_with_id(id) # Instantiate card types stored in this database. Since they could # depend on a plugin, the card types need to be instatiated last. for id in defined_in_database_ids: @@ -392,7 +395,7 @@ for f in self.component_manager.all("hook", "after_load"): f.run() # We don't log the database load here, but in libmnemosyne.__init__, - # as we prefer to log the start of the program first. + # as we prefer to log the start of the program first. def save(self, path=None): # Update format. @@ -408,7 +411,8 @@ drive = os.path.splitdrive(path)[0] import ctypes if ctypes.windll.kernel32.GetDriveTypeW("%s\\" % drive) == 4: - raise RuntimeError(_("Putting a database on a network drive is forbidden under Windows to avoid data corruption.")) + raise RuntimeError(\ +_("Putting a database on a network drive is forbidden under Windows to avoid data corruption.")) copy(self._path, dest_path) self._path = dest_path self.config()["last_database"] \ @@ -418,12 +422,16 @@ def backup(self): self.save() - if self.config()["backups_to_keep"] == 0: + if self.config()["max_backups"] == 0: return backupdir = os.path.join(self.config().data_dir, "backups") db_name = os.path.basename(self._path).rsplit(".", 1)[0] - backupfile = db_name + "-" + \ - datetime.datetime.today().strftime("%Y%m%d-%H%M%S.db") + try: + backupfile = db_name + "-" + \ + datetime.datetime.today().strftime("%Y%m%d-%H%M%S.db") + except: # Work around strange Android library bug. + from mnemosyne.libmnemosyne.utils import rand_uuid + backupfile = db_name + "-" + rand_uuid() + ".db" backupfile = os.path.join(backupdir, backupfile) failed = False try: @@ -438,13 +446,11 @@ for f in self.component_manager.all("hook", "after_backup"): f.run(backupfile) # Only keep the last logs. - if self.config()["backups_to_keep"] < 0: - return backupfile files = [f for f in os.listdir(backupdir) \ if f.startswith(db_name + "-")] files.sort() - if len(files) > self.config()["backups_to_keep"]: - surplus = len(files) - self.config()["backups_to_keep"] + if len(files) > self.config()["max_backups"]: + surplus = len(files) - self.config()["max_backups"] for file in files[0:surplus]: os.remove(os.path.join(backupdir, file)) return backupfile @@ -601,7 +607,7 @@ answer = self.main_widget().show_question(\ _("Make tag '%s' active in saved set '%s'?") % \ (tag.name, saved_criterion.name), _("Yes"), _("No"), "") - except NotImplementedError: + except NotImplementedError: # We are running in a non interactive mode. answer = 0 # Yes if answer == 1: # No. @@ -638,8 +644,8 @@ new_name = tag.name stored_name = self.con.execute("select name from tags where _id=?", (tag._id, )).fetchone()[0] - if new_name != stored_name and self.con.execute("""select count() from - tags where name=?""", (new_name, )).fetchone()[0] != 0: + if new_name != stored_name and self.con.execute("""select 1 from + tags where name=? limit 1""", (new_name, )).fetchone() is not None: _existing_tag_id = self.con.execute("""select _id from tags where name=?""", (new_name, )).fetchone()[0] _card_ids_affected = [cursor[0] for cursor in self.con.execute(\ @@ -648,9 +654,9 @@ for _card_id in _card_ids_affected: # If the card already had a tag with the updated name, delete # the other tag. - if self.con.execute("""select count() from tags_for_card where - _tag_id=? and _card_id=?""", (_existing_tag_id, _card_id))\ - .fetchone()[0] > 0: + if self.con.execute("""select 1 from tags_for_card where + _tag_id=? and _card_id=? limit 1""", + (_existing_tag_id, _card_id)).fetchone() is not None: self.con.execute("""delete from tags_for_card where _tag_id=? and _card_id=?""", (tag._id, _card_id)) # If not, update the link. @@ -706,8 +712,8 @@ self.con.execute("delete from tags_for_card where _tag_id=?", (tag._id, )) for _card_id in _card_ids_affected: - if self.con.execute("""select count() from tags_for_card where - _card_id=?""", (_card_id, )).fetchone()[0] == 0: + if self.con.execute("""select 1 from tags_for_card where + _card_id=? limit 1""", (_card_id, )).fetchone() is None: untagged = self.get_or_create_tag_with_name("__UNTAGGED__") self.con.execute("""insert into tags_for_card(_tag_id, _card_id) values(?,?)""", (untagged._id, _card_id)) @@ -736,9 +742,9 @@ def delete_tag_if_unused(self, tag): if tag.id == "__UNTAGGED__": return - if self.con.execute("""select count() from tags as cat, + if self.con.execute("""select 1 from tags as cat, tags_for_card as cat_c where cat_c._tag_id=cat._id and - cat._id=?""", (tag._id, )).fetchone()[0] == 0: + cat._id=? limit 1""", (tag._id, )).fetchone() is None: self.delete_tag(tag) def tags(self): @@ -760,10 +766,10 @@ break index += 1 return result - + def has_tag_with_id(self, id): - return self.con.execute("select count() from tags where id=?", - (id, )).fetchone()[0] != 0 + return self.con.execute("select 1 from tags where id=? limit 1", + (id, )).fetchone() is not None # # Facts. @@ -815,10 +821,10 @@ (fact._id, )) self.log().deleted_fact(fact) del fact - + def has_fact_with_id(self, id): - return self.con.execute("select count() from facts where id=?", - (id, )).fetchone()[0] != 0 + return self.con.execute("select 1 from facts where id=? limit 1", + (id, )).fetchone() is not None # # Cards. @@ -941,7 +947,7 @@ _card_id) values(?,?)""", (tag._id, card._id)) def delete_card(self, card, check_for_unused_tags=True): - if card._id is None: + if card._id is None: # A card which was created and deleted before a sync, so that # it has incomplete information. self.con.execute("delete from cards where id=?", (card.id, )) @@ -1024,9 +1030,9 @@ (EventTypes.EDITED_CARD, int(time.time()), card_id)) def has_card_with_id(self, id): - return self.con.execute("select count() from cards where id=?", - (id, )).fetchone()[0] != 0 - + return self.con.execute("select 1 from cards where id=? limit 1", + (id, )).fetchone() is not None + # # Fact views. # @@ -1077,19 +1083,19 @@ (fact_view.id, )) self.log().deleted_fact_view(fact_view) del fact_view - + def has_fact_view_with_id(self, id): - return self.con.execute("select count() from fact_views where id=?", - (id, )).fetchone()[0] != 0 + return self.con.execute("select 1 from fact_views where id=? limit 1", + (id, )).fetchone() is not None # # Card types. # - + def activate_plugins_for_card_type_with_id(self, id): builtin_ids = set(card_type.id for card_type in self.card_types()) defined_in_database_ids = [cursor[0] for cursor in \ - self.con.execute("select id from card_types")] + self.con.execute("select id from card_types")] # Check if parents are missing plugins. plugin_needed_ids = set() while "::" in id: # Move up one level of the hierarchy. @@ -1111,9 +1117,11 @@ raise RuntimeError(_("Error when running plugin:") \ + "\n" + traceback_string()) if not found: - raise RuntimeError(_("Missing plugin for card type with id:") + " " + card_type_id) + raise RuntimeError(_("Missing plugin for card type with id:") +\ + " " + card_type_id) def add_card_type(self, card_type): + card_type.extra_data["hidden_from_UI"] = card_type.hidden_from_UI self.con.execute("""insert into card_types(id, name, fact_keys_and_names, unique_fact_keys, required_fact_keys, fact_view_ids, keyboard_shortcuts, extra_data) @@ -1146,8 +1154,8 @@ criteria_to_activate_card_type_in = [current_criterion] else: answer = self.main_widget().show_question(\ - _("Make new card type active in saved set '%s'?") % \ - (saved_criterion.name,), _("Yes"), _("No"), "") + _("Make new card type '%s' active in saved set '%s'?") % \ + (card_type.name, saved_criterion.name), _("Yes"), _("No"), "") if answer == 1: # No. criteria_to_activate_card_type_in = [] else: @@ -1182,23 +1190,25 @@ card_type.required_fact_keys = eval(sql_res[3]) card_type.keyboard_shortcuts = eval(sql_res[5]) self._construct_extra_data(sql_res[6], card_type) + if "hidden_from_UI" in card_type.extra_data: + card_type.hidden_from_UI = card_type.extra_data["hidden_from_UI"] card_type.fact_views = [self.fact_view(fact_view_id, is_id_internal=False) for fact_view_id in eval(sql_res[4])] return card_type def is_user_card_type(self, card_type): - return self.con.execute("select count() from card_types where id=?", - (card_type.id, )).fetchone()[0] == 1 + return self.con.execute("select 1 from card_types where id=? limit 1", + (card_type.id, )).fetchone() is not None def is_in_use(self, card_type): return self.con.execute(\ - "select count() from cards where card_type_id=?", - (card_type.id, )).fetchone()[0] != 0 + "select 1 from cards where card_type_id=? limit 1", + (card_type.id, )).fetchone() is not None def has_clones(self, card_type): - return self.con.execute(\ - "select count() from card_types where id like ?", - (card_type.id + "::%", )).fetchone()[0] != 0 + return self.con.execute(\ + "select 1 from card_types where id like ? limit 1", + (card_type.id + "::%", )).fetchone() is not None def update_card_type(self, card_type): # Updating of the fact views should happen at the controller level, @@ -1232,14 +1242,14 @@ criterion.card_type_deleted(card_type) self.update_criterion(criterion) del card_type - + def has_card_type_with_id(self, id): - #if self.con.execute("select count() from card_types where id=?", - # (id, )).fetchone()[0] != 0: + #if self.con.execute("select 1 from card_types where id=? limit 1", + # (id, )).fetchone() is not None: # return True #else: # It could be a built-in card type. return id in [card_type.id for card_type in self.card_types()] - + # # Criteria. # @@ -1299,11 +1309,11 @@ def criteria(self): return (self.criterion(cursor[0], is_id_internal=True) \ for cursor in self.con.execute("select _id from criteria")) - + def has_criterion_with_id(self, id): - return self.con.execute("select count() from criteria where id=?", - (id, )).fetchone()[0] != 0 - + return self.con.execute("select 1 from criteria where id=? limit 1", + (id, )).fetchone() is not None + # # Queries. @@ -1538,22 +1548,59 @@ active=1 and grade>=2 and ?1 and ret_reps between 1 and " + str(max_ret_reps)) return ((cursor[0], cursor[1]) for cursor in self.con.execute(""" - select _id, _fact_id from cards where - active=1 and scheduler_data=? order by %s limit ?""" - % sort_key, (scheduler_data, limit))) - - def scheduler_data_count(self, scheduler_data): + select _id, _fact_id from cards where active=1 and scheduler_data=? + %s order by %s limit ?""" + % (extra_cond, sort_key), (scheduler_data, limit))) + + def scheduler_data_count(self, scheduler_data, max_ret_reps=-1): + extra_cond = "" if max_ret_reps == -1 else str( + "and acq_reps>1 and ret_reps between 1 and " + str(max_ret_reps)) return self.con.execute("""select count() from cards - where active=1 and scheduler_data=?""", + where active=1 and scheduler_data=? %s """ % extra_cond, (scheduler_data, )).fetchone()[0] + + # + # Extra queries for language analysis. + # + + def _where_clause_known_recognition_questions(self, card_type_ids): + clause = "where grade>=2 and ( " + args = [] + for card_type_id in card_type_ids: + clause += "(card_type_id=? and fact_view_id=?) or " + args += [card_type_id, card_type_id + ".1"] + clause = clause.rsplit("or ", 1)[0] + ")" + return clause, args + + def known_recognition_questions_count_from_card_types_ids(\ + self, card_type_ids): + clause, args = \ + self._where_clause_known_recognition_questions(card_type_ids) + return self.con.execute(\ + "select count() from cards " + clause, args).fetchone()[0] + + def known_recognition_questions_from_card_types_ids(self, card_type_ids): + clause, args = \ + self._where_clause_known_recognition_questions(card_type_ids) + return (cursor[0] for cursor in \ + self.con.execute("select question from cards " + clause, args)) + diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/databases/SQLite_sync.py mnemosyne-2.6+ds/mnemosyne/libmnemosyne/databases/SQLite_sync.py --- mnemosyne-2.4/mnemosyne/libmnemosyne/databases/SQLite_sync.py 2016-08-04 14:57:11.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/databases/SQLite_sync.py 2018-02-07 21:03:52.000000000 +0000 @@ -18,7 +18,9 @@ from mnemosyne.libmnemosyne.translator import _ from mnemosyne.libmnemosyne.card_type import CardType from mnemosyne.libmnemosyne.fact_view import FactView -from mnemosyne.libmnemosyne.utils import expand_path, MnemosyneError +from mnemosyne.libmnemosyne.utils import MnemosyneError +from mnemosyne.libmnemosyne.utils import normalise_path, expand_path + re_src = re.compile(r"""(src|data)=\"(.+?)\"""", re.DOTALL | re.IGNORECASE) @@ -185,8 +187,9 @@ """select object_id from log where _id>? and (event_type=? or event_type=?)""", (_id, EventTypes.ADDED_MEDIA_FILE, EventTypes.EDITED_MEDIA_FILE))]: - if os.path.exists(expand_path(filename, self.media_dir())): - filenames.add(filename) + if os.path.exists(\ + normalise_path(expand_path(filename, self.media_dir()))): + filenames.add(filename) return filenames def all_media_filenames(self): @@ -196,7 +199,7 @@ # We cannot rely on logs in the database here, since part of it # may have been archived, so we simply send across the entire # media directory. - + filenames = set() for root, dirs, files in os.walk(self.media_dir()): subdir = root.replace(self.media_dir(), "") @@ -267,7 +270,7 @@ _fact_id from cards where active=1) and value like '%src=%'"""): for match in re_src.finditer(result[0]): active_objects["media_filenames"].add(match.group(2)) - return active_objects + return active_objects def set_extra_tags_on_import(self, tags): self.extra_tags_on_import = tags @@ -410,10 +413,10 @@ def add_tag_from_log_entry(self, log_entry): already_imported = self.has_tag_with_id(log_entry["o_id"]) if "name" not in log_entry: - log_entry["name"] = "dummy" # Added and immediately deleted. + log_entry["name"] = "dummy" # Added and immediately deleted. same_name_in_database = self.con.execute(\ - "select count() from tags where name=? and id!=?", - (log_entry["name"], log_entry["o_id"])).fetchone()[0] == 1 + "select 1 from tags where name=? and id!=? limit 1", + (log_entry["name"], log_entry["o_id"])).fetchone() is not None if same_name_in_database: # Merging with the tag which is already in the database is more # difficult, as then the tag links in the cards would need to @@ -433,7 +436,7 @@ # the object from the database. This is a bit slower than just filling # in harmless missing keys, but it is more robust against future # side effects of tag deletion. - if log_entry["type"] == EventTypes.DELETED_TAG: + if log_entry["type"] == EventTypes.DELETED_TAG: # Work around legacy logs which contain duplicate deletion events. if self.has_tag_with_id(log_entry["o_id"]): return self.tag(log_entry["o_id"], is_id_internal=False) @@ -442,7 +445,7 @@ self.main_widget().show_information(\ _("Deleting same tag twice during sync. Inform the developpers.")) log_entry["name"] = "irrelevant" - return Tag(log_entry["name"], log_entry["o_id"]) + return Tag(log_entry["name"], log_entry["o_id"]) # If we are creating a tag that will be deleted at a later stage # during this sync, we are missing some (irrelevant) information # needed to properly create a tag object. @@ -474,10 +477,10 @@ if log_entry["type"] != EventTypes.ADDED_FACT and \ not self.has_fact_with_id(log_entry["o_id"]): self.main_widget().show_information(\ - _("Deleting same fact twice during sync. Inform the developpers.")) + _("Deleting same fact twice during sync. Inform the developpers.")) fact = Fact({}, log_entry["o_id"]) fact._id = -1 - return fact + return fact # Get fact object to be deleted now. if log_entry["type"] == EventTypes.DELETED_FACT: return self.fact(log_entry["o_id"], is_id_internal=False) @@ -489,7 +492,7 @@ fact = Fact(fact_data, log_entry["o_id"]) if log_entry["type"] != EventTypes.ADDED_FACT: fact._id = self.con.execute("select _id from facts where id=?", - (fact.id, )).fetchone()[0] + (fact.id, )).fetchone()[0] return fact def add_card_from_log_entry(self, log_entry): @@ -539,7 +542,7 @@ return self.card(log_entry["o_id"], is_id_internal=False) except MnemosyneError: # There is no fact in the database. # We have created and deleted this card since the last sync, - # so we just return an empty shell. + # so we just return an empty shell. card_type = self.card_type_with_id("1") fact = Fact({"f": "f", "b": "b"}, id="") card = Card(card_type, fact, card_type.fact_views[0], @@ -564,10 +567,10 @@ if log_entry["card_t"] not in \ self.component_manager.card_type_with_id: # If the card type is not in the database, it's possible that - # the data for this card type will follow later during the - # sync. In that case, create a dummy card type here, which - # will be corrected by a later edit event. Hovewer, we still - # need to instantiate this card type later, so that we can + # the data for this card type will follow later during the + # sync. In that case, create a dummy card type here, which + # will be corrected by a later edit event. Hovewer, we still + # need to instantiate this card type later, so that we can # catch errors, e.g. due to bad plugins. try: self.activate_plugins_for_card_type_with_id\ @@ -664,7 +667,7 @@ """ filename = log_entry["fname"] - full_path = expand_path(filename, self.media_dir()) + full_path = normalise_path(expand_path(filename, self.media_dir())) if os.path.exists(full_path): self.con.execute("""insert or replace into media(filename, _hash) values(?,?)""", (filename, self._media_hash(filename))) @@ -678,10 +681,10 @@ def delete_media_file(self, log_entry): # Actually, we cannot take the responsibility to delete a media file, - # since it would e.g. break the corner case to add a media file, + # since it would e.g. break the corner case to add a media file, # delete it and than add it again. pass - + #filename = log_entry["fname"] #full_path = expand_path(filename, self.media_dir()) # The file could have been remotely deleted before it got a chance to @@ -693,8 +696,8 @@ def add_fact_view_from_log_entry(self, log_entry): if self.importing: already_imported = self.con.execute(\ - "select count() from fact_views where id=?", - (log_entry["o_id"], )).fetchone()[0] != 0 + "select 1 from fact_views where id=? limit 1", + (log_entry["o_id"], )).fetchone() is not None # No need to rename fact views here, as the user only names the # card types. if already_imported: @@ -730,13 +733,13 @@ def add_card_type_from_log_entry(self, log_entry): already_imported = self.con.execute(\ - "select count() from card_types where id=?", - (log_entry["o_id"], )).fetchone()[0] != 0 + "select 1 from card_types where id=? limit 1", + (log_entry["o_id"], )).fetchone() is not None if "name" not in log_entry: log_entry["name"] = "dummy" # Added and immediately deleted. same_name_in_database = self.con.execute(\ - "select count() from card_types where name=? and id!=?", - (log_entry["name"], log_entry["o_id"] )).fetchone()[0] == 1 + "select 1 from card_types where name=? and id!=? limit 1", + (log_entry["name"], log_entry["o_id"] )).fetchone() is not None if same_name_in_database: # Merging with the card type which is already in the database # is more difficult, as then the card type links in the cards @@ -757,7 +760,7 @@ except sqlite3.IntegrityError: # Leftover from old bug, should not reoccur. self.main_widget().show_information(\ - _("Creating same card type twice during sync. Inform the developpers.")) + _("Creating same card type twice during sync. Inform the developpers.")) def card_type_from_log_entry(self, log_entry): # Get card type object to be deleted now. @@ -784,7 +787,7 @@ card_type.required_fact_keys = eval(log_entry["required_fact_keys"]) card_type.keyboard_shortcuts = eval(log_entry["keyboard_shortcuts"]) if "extra" in log_entry: - card_type.extra_data = eval(log_entry["extra"]) + card_type.extra_data = eval(log_entry["extra"]) return card_type def criterion_from_log_entry(self, log_entry): @@ -823,11 +826,11 @@ self.importing = True event_type = log_entry["type"] if "time" in log_entry: - self.log().timestamp = int(log_entry["time"]) + self.log().timestamp = int(log_entry["time"]) # TMP measure to allow syncing partners which did not yet store # machine ids for LOADED_DATABASE and SAVED_DATABASE. if not "o_id" in log_entry: - log_entry["o_id"] = "" + log_entry["o_id"] = "" try: if event_type == EventTypes.STARTED_PROGRAM: self.log().started_program(log_entry["o_id"]) @@ -889,7 +892,7 @@ self.reapply_default_criterion_needed = True elif event_type == EventTypes.DELETED_CRITERION: self.delete_criterion(self.criterion_from_log_entry(log_entry)) - elif event_type == EventTypes.EDITED_SETTING: + elif event_type == EventTypes.EDITED_SETTING: key, value = log_entry["o_id"], eval(log_entry["value"]) if key in self.config().keys_to_sync: self.config()[key] = value diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/.buildinfo mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/.buildinfo --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/.buildinfo 2016-11-29 15:44:06.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/.buildinfo 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -# Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 4c27ab72bd75d4c516605b10e41e9336 -tags: 645f666f9bcd5a90fca523b33c5a78b7 diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/genindex.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/genindex.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/genindex.html 2016-11-29 15:44:04.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/genindex.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,1792 +0,0 @@ - - - - - - - - - Index — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- - -

Index

- -
- A - | B - | C - | D - | E - | F - | G - | H - | I - | K - | L - | M - | N - | P - | Q - | R - | S - | T - | U - | V - -
-

A

- - - -
- -
abandon() (mnemosyne.libmnemosyne.database.Database method) -
- - -
activate() (mnemosyne.libmnemosyne.component.Component method) -
- -
- -
(mnemosyne.libmnemosyne.configuration.Configuration method) -
- - -
(mnemosyne.libmnemosyne.logger.Logger method) -
- - -
(mnemosyne.libmnemosyne.plugin.Plugin method) -
- -
- -
active_card_type_added() (mnemosyne.libmnemosyne.criterion.Criterion method) -
- - -
active_count() (mnemosyne.libmnemosyne.scheduler.Scheduler method) -
- - -
active_tag_added() (mnemosyne.libmnemosyne.criterion.Criterion method) -
- - -
add_card() (mnemosyne.libmnemosyne.database.Database method) -
- - -
add_card_type() (mnemosyne.libmnemosyne.database.Database method) -
- - -
add_component_to_plugin() (mnemosyne.libmnemosyne.component_manager.ComponentManager method) -
- - -
add_criterion() (mnemosyne.libmnemosyne.database.Database method) -
- - -
add_fact() (mnemosyne.libmnemosyne.database.Database method) -
- - -
add_fact_view() (mnemosyne.libmnemosyne.database.Database method) -
- -
- -
add_tag() (mnemosyne.libmnemosyne.database.Database method) -
- - -
add_tag_to_cards_with_internal_ids() (mnemosyne.libmnemosyne.database.Database method) -
- - -
added_card() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
added_card_type() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
added_criterion() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
added_fact() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
added_fact_view() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
added_media_file() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
added_tag() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
all() (mnemosyne.libmnemosyne.component_manager.ComponentManager method) -
- - -
answer() (mnemosyne.libmnemosyne.card.Card method) -
- - -
apply_to_card() (mnemosyne.libmnemosyne.criterion.Criterion method) -
- - -
apply_to_database() (mnemosyne.libmnemosyne.criterion.CriterionApplier method) -
- - -
archive_old_log() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
avoid_sister_cards() (mnemosyne.libmnemosyne.scheduler.Scheduler method) -
- -
- -

B

- - -
- -
backup() (mnemosyne.libmnemosyne.database.Database method) -
- -
- -

C

- - - -
- -
Card (class in mnemosyne.libmnemosyne.card) -
- - -
card() (mnemosyne.libmnemosyne.database.Database method) -
- - -
card_count_scheduled_n_days_from_now() (mnemosyne.libmnemosyne.scheduler.Scheduler method) -
- - -
card_type() (mnemosyne.libmnemosyne.database.Database method) -
- - -
card_type_deleted() (mnemosyne.libmnemosyne.criterion.Criterion method) -
- - -
card_type_property() (mnemosyne.libmnemosyne.configuration.Configuration method) -
- - -
card_type_with_id() (mnemosyne.libmnemosyne.component.Component method) -
- - -
card_types() (mnemosyne.libmnemosyne.component.Component method) -
- - -
card_types_in_use() (mnemosyne.libmnemosyne.database.Database method) -
- - -
cards() (mnemosyne.libmnemosyne.database.Database method) -
- - -
cards_due_for_ret_rep() (mnemosyne.libmnemosyne.database.Database method) -
- - -
cards_from_fact() (mnemosyne.libmnemosyne.database.Database method) -
- - -
cards_learn_ahead() (mnemosyne.libmnemosyne.database.Database method) -
- - -
cards_new_memorising() (mnemosyne.libmnemosyne.database.Database method) -
- - -
cards_to_relearn() (mnemosyne.libmnemosyne.database.Database method) -
- - -
cards_unseen() (mnemosyne.libmnemosyne.database.Database method) -
- - -
cards_with_scheduler_data() (mnemosyne.libmnemosyne.database.Database method) -
- - -
CardType (class in mnemosyne.libmnemosyne.card_type) -
- - -
CardTypeConverter (class in mnemosyne.libmnemosyne.card_type_converter) -
- - -
change_card_type() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
change_user_id() (mnemosyne.libmnemosyne.configuration.Configuration method) -
- -
- -
(mnemosyne.libmnemosyne.database.Database method) -
- -
- -
clone_card_type() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
clone_card_type_properties() (mnemosyne.libmnemosyne.configuration.Configuration method) -
- - -
Component (class in mnemosyne.libmnemosyne.component) -
- - -
component_type (mnemosyne.libmnemosyne.card_type.CardType attribute) -
- -
- -
(mnemosyne.libmnemosyne.card_type_converter.CardTypeConverter attribute) -
- - -
(mnemosyne.libmnemosyne.component.Component attribute) -
- - -
(mnemosyne.libmnemosyne.configuration.Configuration attribute) -
- - -
(mnemosyne.libmnemosyne.controller.Controller attribute) -
- - -
(mnemosyne.libmnemosyne.criterion.Criterion attribute) -
- - -
(mnemosyne.libmnemosyne.criterion.CriterionApplier attribute) -
- - -
(mnemosyne.libmnemosyne.database.Database attribute) -
- - -
(mnemosyne.libmnemosyne.file_format.FileFormat attribute) -
- - -
(mnemosyne.libmnemosyne.filter.Filter attribute) -
- - -
(mnemosyne.libmnemosyne.hook.Hook attribute) -
- - -
(mnemosyne.libmnemosyne.logger.Logger attribute) -
- - -
(mnemosyne.libmnemosyne.plugin.Plugin attribute) -
- - -
(mnemosyne.libmnemosyne.render_chain.RenderChain attribute) -
- - -
(mnemosyne.libmnemosyne.renderer.Renderer attribute) -
- - -
(mnemosyne.libmnemosyne.review_controller.ReviewController attribute) -
- - -
(mnemosyne.libmnemosyne.scheduler.Scheduler attribute) -
- - -
(mnemosyne.libmnemosyne.statistics_page.StatisticsPage attribute) -
- - -
(mnemosyne.libmnemosyne.stopwatch.Stopwatch attribute) -
- -
-
- -
ComponentManager (class in mnemosyne.libmnemosyne.component_manager) -
- - -
components (mnemosyne.libmnemosyne.plugin.Plugin attribute) -
- - -
config() (mnemosyne.libmnemosyne.component.Component method) -
- - -
Configuration (class in mnemosyne.libmnemosyne.configuration) -
- - -
Controller (class in mnemosyne.libmnemosyne.controller) -
- - -
controller() (mnemosyne.libmnemosyne.component.Component method) -
- - -
convert() (mnemosyne.libmnemosyne.card_type_converter.CardTypeConverter method) -
- - -
counters() (mnemosyne.libmnemosyne.review_controller.ReviewController method) -
- - -
create_new_cards() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
create_sister_cards() (mnemosyne.libmnemosyne.card_type.CardType method) -
- - -
criteria() (mnemosyne.libmnemosyne.database.Database method) -
- - -
Criterion (class in mnemosyne.libmnemosyne.criterion) -
- - -
criterion() (mnemosyne.libmnemosyne.database.Database method) -
- - -
criterion_type (mnemosyne.libmnemosyne.criterion.Criterion attribute) -
- - -
CriterionApplier (class in mnemosyne.libmnemosyne.criterion) -
- - -
current() (mnemosyne.libmnemosyne.component_manager.ComponentManager method) -
- - -
current_criterion() (mnemosyne.libmnemosyne.database.Database method) -
- -
- -

D

- - - -
- -
data_dir() (mnemosyne.libmnemosyne.database.Database method) -
- - -
data_to_string() (mnemosyne.libmnemosyne.criterion.Criterion method) -
- - -
data_to_sync_string() (mnemosyne.libmnemosyne.criterion.Criterion method) -
- - -
Database (class in mnemosyne.libmnemosyne.database) -
- - -
database() (mnemosyne.libmnemosyne.component.Component method) -
- - -
deactivate() (mnemosyne.libmnemosyne.component.Component method) -
- -
- -
(mnemosyne.libmnemosyne.database.Database method) -
- - -
(mnemosyne.libmnemosyne.logger.Logger method) -
- - -
(mnemosyne.libmnemosyne.plugin.Plugin method) -
- -
- -
deactivate_all() (mnemosyne.libmnemosyne.component_manager.ComponentManager method) -
- - -
deactivated_card_type_added() (mnemosyne.libmnemosyne.criterion.Criterion method) -
- - -
deactivated_tag_added() (mnemosyne.libmnemosyne.criterion.Criterion method) -
- - -
debug() (mnemosyne.libmnemosyne.component_manager.ComponentManager method) -
- - -
default_criterion_name (mnemosyne.libmnemosyne.database.Database attribute) -
- - -
default_name (mnemosyne.libmnemosyne.database.Database attribute) -
- - -
delete_card() (mnemosyne.libmnemosyne.database.Database method) -
- - -
delete_card_type() (mnemosyne.libmnemosyne.controller.Controller method) -
- -
- -
(mnemosyne.libmnemosyne.database.Database method) -
- -
- -
delete_card_type_properties() (mnemosyne.libmnemosyne.configuration.Configuration method) -
- - -
delete_criterion() (mnemosyne.libmnemosyne.database.Database method) -
- - -
delete_current_card() (mnemosyne.libmnemosyne.controller.Controller method) -
- -
- -
delete_fact() (mnemosyne.libmnemosyne.database.Database method) -
- - -
delete_fact_view() (mnemosyne.libmnemosyne.database.Database method) -
- - -
delete_facts_and_their_cards() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
delete_plugin() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
delete_subtree() (mnemosyne.libmnemosyne.tag_tree.TagTree method) -
- - -
delete_tag() (mnemosyne.libmnemosyne.database.Database method) -
- - -
delete_tag_if_unused() (mnemosyne.libmnemosyne.database.Database method) -
- - -
deleted_card() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
deleted_card_type() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
deleted_criterion() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
deleted_fact() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
deleted_fact_view() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
deleted_media_file() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
deleted_tag() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
description (mnemosyne.libmnemosyne.file_format.FileFormat attribute) -
- -
- -
(mnemosyne.libmnemosyne.plugin.Plugin attribute) -
- -
- -
determine_dirs() (mnemosyne.libmnemosyne.configuration.Configuration method) -
- - -
display_name() (mnemosyne.libmnemosyne.database.Database method) -
- - -
do_import() (mnemosyne.libmnemosyne.file_format.FileFormat method) -
- - -
dump_to_science_log() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
duplicates_for_fact() (mnemosyne.libmnemosyne.database.Database method) -
- -
- -

E

- - - -
- -
edit_card_and_sisters() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
edit_fact() (mnemosyne.libmnemosyne.card_type.CardType method) -
- - -
edited_card() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
edited_card_type() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
edited_criterion() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
edited_fact() (mnemosyne.libmnemosyne.logger.Logger method) -
- -
- -
edited_fact_view() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
edited_media_file() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
edited_setting() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
edited_tag() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
export_possible (mnemosyne.libmnemosyne.file_format.FileFormat attribute) -
- - -
extension (mnemosyne.libmnemosyne.file_format.FileFormat attribute) -
- - -
extra_data (mnemosyne.libmnemosyne.card_type.CardType attribute) -
- -
- -

F

- - - -
- -
Fact (class in mnemosyne.libmnemosyne.fact) -
- - -
fact() (mnemosyne.libmnemosyne.database.Database method) -
- - -
fact_data() (mnemosyne.libmnemosyne.card_type.CardType method) -
- - -
fact_key_format_proxies() (mnemosyne.libmnemosyne.card_type.CardType method) -
- - -
fact_key_names() (mnemosyne.libmnemosyne.card_type.CardType method) -
- - -
fact_key_with_name() (mnemosyne.libmnemosyne.card_type.CardType method) -
- - -
fact_keys() (mnemosyne.libmnemosyne.card_type.CardType method) -
- - -
fact_keys_and_names (mnemosyne.libmnemosyne.card_type.CardType attribute) -
- - -
fact_view() (mnemosyne.libmnemosyne.database.Database method) -
- -
- -
fact_views (mnemosyne.libmnemosyne.card_type.CardType attribute) -
- - -
FactView (class in mnemosyne.libmnemosyne.fact_view) -
- - -
FileFormat (class in mnemosyne.libmnemosyne.file_format) -
- - -
filename_filter (mnemosyne.libmnemosyne.file_format.FileFormat attribute) -
- - -
fill_dirs() (mnemosyne.libmnemosyne.configuration.Configuration method) -
- - -
Filter (class in mnemosyne.libmnemosyne.filter) -
- - -
filter() (mnemosyne.libmnemosyne.render_chain.RenderChain method) -
- - -
filters (mnemosyne.libmnemosyne.render_chain.RenderChain attribute) -
- - -
flush_sync_server() (mnemosyne.libmnemosyne.component.Component method) -
- -
- -

G

- - - -
- -
get_or_create_tag_with_name() (mnemosyne.libmnemosyne.database.Database method) -
- - -
get_or_create_tags_with_names() (mnemosyne.libmnemosyne.database.Database method) -
- -
- -
get_timestamp() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
grade_answer() (mnemosyne.libmnemosyne.review_controller.ReviewController method) -
- -
- -
(mnemosyne.libmnemosyne.scheduler.Scheduler method) -
- -
-
- -

H

- - - -
- -
has_card_type_with_id() (mnemosyne.libmnemosyne.database.Database method) -
- - -
has_card_with_id() (mnemosyne.libmnemosyne.database.Database method) -
- - -
has_clone() (mnemosyne.libmnemosyne.database.Database method) -
- - -
has_criterion_with_id() (mnemosyne.libmnemosyne.database.Database method) -
- - -
has_fact_view_with_id() (mnemosyne.libmnemosyne.database.Database method) -
- -
- -
has_fact_with_id() (mnemosyne.libmnemosyne.database.Database method) -
- - -
has_tag_with_id() (mnemosyne.libmnemosyne.database.Database method) -
- - -
heartbeat() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
Hook (class in mnemosyne.libmnemosyne.hook) -
- - -
HtmlStatisticsPage (class in mnemosyne.libmnemosyne.statistics_page) -
- -
- -

I

- - - -
- -
id (mnemosyne.libmnemosyne.card_type.CardType attribute) -
- -
- -
(mnemosyne.libmnemosyne.render_chain.RenderChain attribute) -
- -
- -
IMMEDIATELY (mnemosyne.libmnemosyne.component.Component attribute) -
- - -
import_possible (mnemosyne.libmnemosyne.file_format.FileFormat attribute) -
- - -
install_plugin() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
instantiate (mnemosyne.libmnemosyne.component.Component attribute) -
- -
- -
(mnemosyne.libmnemosyne.criterion.Criterion attribute) -
- - -
(mnemosyne.libmnemosyne.statistics_page.StatisticsPage attribute) -
- -
- -
is_answer_showing() (mnemosyne.libmnemosyne.review_controller.ReviewController method) -
- -
- -
is_empty() (mnemosyne.libmnemosyne.criterion.Criterion method) -
- -
- -
(mnemosyne.libmnemosyne.database.Database method) -
- -
- -
is_fact_data_valid() (mnemosyne.libmnemosyne.card_type.CardType method) -
- - -
is_in_queue() (mnemosyne.libmnemosyne.scheduler.Scheduler method) -
- - -
is_in_use() (mnemosyne.libmnemosyne.database.Database method) -
- - -
is_loaded() (mnemosyne.libmnemosyne.database.Database method) -
- - -
is_prefetch_allowed() (mnemosyne.libmnemosyne.scheduler.Scheduler method) -
- - -
is_question_showing() (mnemosyne.libmnemosyne.review_controller.ReviewController method) -
- - -
is_tag_active() (mnemosyne.libmnemosyne.criterion.Criterion method) -
- - -
is_user_card_type() (mnemosyne.libmnemosyne.database.Database method) -
- -
- -

K

- - -
- -
keyboard_shortcuts (mnemosyne.libmnemosyne.card_type.CardType attribute) -
- -
- -

L

- - - -
- -
last_rep_to_interval_string() (mnemosyne.libmnemosyne.scheduler.Scheduler method) -
- - -
LATER (mnemosyne.libmnemosyne.component.Component attribute) -
- - -
load() (mnemosyne.libmnemosyne.configuration.Configuration method) -
- -
- -
(mnemosyne.libmnemosyne.database.Database method) -
- -
- -
load_user_config() (mnemosyne.libmnemosyne.configuration.Configuration method) -
- -
- -
loaded_database() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
log() (mnemosyne.libmnemosyne.component.Component method) -
- - -
log_index_of_last_upload() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
Logger (class in mnemosyne.libmnemosyne.logger) -
- - -
LogUploader (class in mnemosyne.libmnemosyne.log_uploader) -
- -
- -

M

- - - -
- -
machine_id() (mnemosyne.libmnemosyne.configuration.Configuration method) -
- - -
main_widget() (mnemosyne.libmnemosyne.component.Component method) -
- - -
mnemosyne.libmnemosyne.card (module) -
- - -
mnemosyne.libmnemosyne.card_type (module) -
- - -
mnemosyne.libmnemosyne.card_type_converter (module) -
- - -
mnemosyne.libmnemosyne.component (module) -
- - -
mnemosyne.libmnemosyne.component_manager (module) -
- - -
mnemosyne.libmnemosyne.configuration (module) -
- - -
mnemosyne.libmnemosyne.controller (module) -
- - -
mnemosyne.libmnemosyne.criterion (module) -
- - -
mnemosyne.libmnemosyne.database (module) -
- - -
mnemosyne.libmnemosyne.fact (module) -
- - -
mnemosyne.libmnemosyne.fact_view (module) -
- -
- -
mnemosyne.libmnemosyne.file_format (module) -
- - -
mnemosyne.libmnemosyne.filter (module) -
- - -
mnemosyne.libmnemosyne.hook (module) -
- - -
mnemosyne.libmnemosyne.log_uploader (module) -
- - -
mnemosyne.libmnemosyne.logger (module) -
- - -
mnemosyne.libmnemosyne.plugin (module) -
- - -
mnemosyne.libmnemosyne.render_chain (module) -
- - -
mnemosyne.libmnemosyne.renderer (module) -
- - -
mnemosyne.libmnemosyne.review_controller (module) -
- - -
mnemosyne.libmnemosyne.scheduler (module) -
- - -
mnemosyne.libmnemosyne.statistics_page (module) -
- - -
mnemosyne.libmnemosyne.stopwatch (module) -
- - -
mnemosyne.libmnemosyne.tag (module) -
- - -
mnemosyne.libmnemosyne.tag_tree (module) -
- -
- -

N

- - - -
- -
name (mnemosyne.libmnemosyne.card_type.CardType attribute) -
- -
- -
(mnemosyne.libmnemosyne.plugin.Plugin attribute) -
- - -
(mnemosyne.libmnemosyne.scheduler.Scheduler attribute) -
- - -
(mnemosyne.libmnemosyne.statistics_page.StatisticsPage attribute) -
- -
-
- -
name() (mnemosyne.libmnemosyne.database.Database method) -
- - -
new() (mnemosyne.libmnemosyne.database.Database method) -
- - -
next_card() (mnemosyne.libmnemosyne.scheduler.Scheduler method) -
- - -
next_rep_to_interval_string() (mnemosyne.libmnemosyne.scheduler.Scheduler method) -
- - -
non_memorised_count() (mnemosyne.libmnemosyne.scheduler.Scheduler method) -
- -
- -

P

- - - -
- -
path() (mnemosyne.libmnemosyne.database.Database method) -
- - -
pause() (mnemosyne.libmnemosyne.stopwatch.Stopwatch method) -
- - -
PlotStatisticsPage (class in mnemosyne.libmnemosyne.statistics_page) -
- -
- -
Plugin (class in mnemosyne.libmnemosyne.plugin) -
- - -
plugins() (mnemosyne.libmnemosyne.component.Component method) -
- - -
prepare_statistics() (mnemosyne.libmnemosyne.statistics_page.StatisticsPage method) -
- -
- -

Q

- - -
- -
question() (mnemosyne.libmnemosyne.card.Card method) -
- -
- -

R

- - - -
- -
rebuild_queue() (mnemosyne.libmnemosyne.scheduler.Scheduler method) -
- - -
register() (mnemosyne.libmnemosyne.component_manager.ComponentManager method) -
- - -
register_filter() (mnemosyne.libmnemosyne.render_chain.RenderChain method) -
- - -
register_filter_at_back() (mnemosyne.libmnemosyne.render_chain.RenderChain method) -
- - -
register_filter_at_front() (mnemosyne.libmnemosyne.render_chain.RenderChain method) -
- - -
register_renderer() (mnemosyne.libmnemosyne.render_chain.RenderChain method) -
- - -
release_connection() (mnemosyne.libmnemosyne.database.Database method) -
- - -
reload_counters() (mnemosyne.libmnemosyne.review_controller.ReviewController method) -
- - -
remove_from_queue_if_present() (mnemosyne.libmnemosyne.scheduler.Scheduler method) -
- - -
remove_tag_from_cards_with_internal_ids() (mnemosyne.libmnemosyne.database.Database method) -
- - -
rename_node() (mnemosyne.libmnemosyne.tag_tree.TagTree method) -
- - -
render() (mnemosyne.libmnemosyne.renderer.Renderer method) -
- - -
render_answer() (mnemosyne.libmnemosyne.card_type.CardType method) -
- -
- -
(mnemosyne.libmnemosyne.render_chain.RenderChain method) -
- -
- -
render_chain() (mnemosyne.libmnemosyne.component.Component method) -
- - -
render_question() (mnemosyne.libmnemosyne.card_type.CardType method) -
- -
- -
(mnemosyne.libmnemosyne.render_chain.RenderChain method) -
- -
-
- -
RenderChain (class in mnemosyne.libmnemosyne.render_chain) -
- - -
Renderer (class in mnemosyne.libmnemosyne.renderer) -
- - -
renderer_for_card_type() (mnemosyne.libmnemosyne.render_chain.RenderChain method) -
- - -
renderers (mnemosyne.libmnemosyne.render_chain.RenderChain attribute) -
- - -
repetition() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
required_fact_keys (mnemosyne.libmnemosyne.card_type.CardType attribute) -
- - -
reset() (mnemosyne.libmnemosyne.review_controller.ReviewController method) -
- -
- -
(mnemosyne.libmnemosyne.scheduler.Scheduler method) -
- -
- -
reset_but_try_to_keep_current_card() (mnemosyne.libmnemosyne.review_controller.ReviewController method) -
- - -
reset_learning_data() (mnemosyne.libmnemosyne.card.Card method) -
- - -
restore() (mnemosyne.libmnemosyne.database.Database method) -
- - -
review_controller() (mnemosyne.libmnemosyne.component.Component method) -
- - -
review_widget() (mnemosyne.libmnemosyne.component.Component method) -
- - -
ReviewController (class in mnemosyne.libmnemosyne.review_controller) -
- - -
run() (mnemosyne.libmnemosyne.filter.Filter method) -
- -
- -
(mnemosyne.libmnemosyne.hook.Hook method) -
- - -
(mnemosyne.libmnemosyne.log_uploader.LogUploader method) -
- -
-
- -

S

- - - -
- -
save() (mnemosyne.libmnemosyne.configuration.Configuration method) -
- -
- -
(mnemosyne.libmnemosyne.database.Database method) -
- -
- -
save_file() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
saved_database() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
scheduled_count() (mnemosyne.libmnemosyne.scheduler.Scheduler method) -
- - -
Scheduler (class in mnemosyne.libmnemosyne.scheduler) -
- - -
scheduler() (mnemosyne.libmnemosyne.component.Component method) -
- - -
scheduler_data_count() (mnemosyne.libmnemosyne.database.Database method) -
- - -
set_card_type_property() (mnemosyne.libmnemosyne.configuration.Configuration method) -
- - -
set_current_criterion() (mnemosyne.libmnemosyne.database.Database method) -
- - -
set_data_from_string() (mnemosyne.libmnemosyne.criterion.Criterion method) -
- - -
set_data_from_sync_string() (mnemosyne.libmnemosyne.criterion.Criterion method) -
- - -
set_defaults() (mnemosyne.libmnemosyne.configuration.Configuration method) -
- - -
set_initial_grade() (mnemosyne.libmnemosyne.scheduler.Scheduler method) -
- - -
set_render_chain() (mnemosyne.libmnemosyne.review_controller.ReviewController method) -
- - -
set_scheduler_data() (mnemosyne.libmnemosyne.database.Database method) -
- - -
set_state() (mnemosyne.libmnemosyne.review_controller.ReviewController method) -
- - -
set_timestamp() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
show_add_cards_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
show_answer() (mnemosyne.libmnemosyne.review_controller.ReviewController method) -
- - -
show_browse_cards_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
show_configuration_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
show_edit_card_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
show_export_file_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
show_getting_started_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
show_import_file_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
show_insert_img_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- -
- -
show_insert_sound_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
show_insert_video_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
show_manage_card_types_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
show_manage_plugins_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
show_new_file_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
show_new_question() (mnemosyne.libmnemosyne.review_controller.ReviewController method) -
- - -
show_open_file_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
show_save_file_as_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
show_statistics_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
show_sync_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
show_tip_dialog() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
show_variants_in_combobox (mnemosyne.libmnemosyne.statistics_page.StatisticsPage attribute) -
- - -
sorted_card_types() (mnemosyne.libmnemosyne.database.Database method) -
- - -
star_current_card() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
start() (mnemosyne.libmnemosyne.stopwatch.Stopwatch method) -
- - -
start_logging() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
start_review() (mnemosyne.libmnemosyne.component.Component method) -
- - -
started_program() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
started_scheduler() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
state() (mnemosyne.libmnemosyne.review_controller.ReviewController method) -
- - -
StatisticsPage (class in mnemosyne.libmnemosyne.statistics_page) -
- - -
stop() (mnemosyne.libmnemosyne.stopwatch.Stopwatch method) -
- - -
stopped_program() (mnemosyne.libmnemosyne.logger.Logger method) -
- - -
Stopwatch (class in mnemosyne.libmnemosyne.stopwatch) -
- - -
stopwatch() (mnemosyne.libmnemosyne.component.Component method) -
- - -
suffix (mnemosyne.libmnemosyne.database.Database attribute) -
- - -
sync() (mnemosyne.libmnemosyne.controller.Controller method) -
- -
- -

T

- - - -
- -
Tag (class in mnemosyne.libmnemosyne.tag) -
- - -
tag() (mnemosyne.libmnemosyne.database.Database method) -
- - -
tag_deleted() (mnemosyne.libmnemosyne.criterion.Criterion method) -
- - -
tag_string() (mnemosyne.libmnemosyne.card.Card method) -
- - -
tags() (mnemosyne.libmnemosyne.database.Database method) -
- -
- -
tags_from_cards_with_internal_ids() (mnemosyne.libmnemosyne.database.Database method) -
- - -
TagTree (class in mnemosyne.libmnemosyne.tag_tree) -
- - -
time() (mnemosyne.libmnemosyne.stopwatch.Stopwatch method) -
- - -
timestamp (mnemosyne.libmnemosyne.logger.Logger attribute) -
- - -
translator() (mnemosyne.libmnemosyne.component.Component method) -
- -
- -

U

- - - -
- -
unique_fact_keys (mnemosyne.libmnemosyne.card_type.CardType attribute) -
- - -
unload() (mnemosyne.libmnemosyne.database.Database method) -
- - -
unpause() (mnemosyne.libmnemosyne.stopwatch.Stopwatch method) -
- - -
unregister() (mnemosyne.libmnemosyne.component_manager.ComponentManager method) -
- - -
unregister_filter() (mnemosyne.libmnemosyne.render_chain.RenderChain method) -
- - -
unregister_renderer() (mnemosyne.libmnemosyne.render_chain.RenderChain method) -
- - -
update() (mnemosyne.libmnemosyne.renderer.Renderer method) -
- - -
update_card() (mnemosyne.libmnemosyne.database.Database method) -
- - -
update_card_type() (mnemosyne.libmnemosyne.database.Database method) -
- - -
update_criterion() (mnemosyne.libmnemosyne.database.Database method) -
- -
- -
update_dialog() (mnemosyne.libmnemosyne.review_controller.ReviewController method) -
- - -
update_fact() (mnemosyne.libmnemosyne.database.Database method) -
- - -
update_fact_view() (mnemosyne.libmnemosyne.database.Database method) -
- - -
update_status_bar_counters() (mnemosyne.libmnemosyne.review_controller.ReviewController method) -
- - -
update_tag() (mnemosyne.libmnemosyne.database.Database method) -
- - -
update_title() (mnemosyne.libmnemosyne.controller.Controller method) -
- - -
upload() (mnemosyne.libmnemosyne.log_uploader.LogUploader method) -
- - -
used_for (mnemosyne.libmnemosyne.component.Component attribute) -
- -
- -
(mnemosyne.libmnemosyne.renderer.Renderer attribute) -
- -
- -
user_id() (mnemosyne.libmnemosyne.database.Database method) -
- -
- -

V

- - - -
- -
variants (mnemosyne.libmnemosyne.statistics_page.StatisticsPage attribute) -
- -
- -
version (mnemosyne.libmnemosyne.database.Database attribute) -
- -
- - - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/index.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/index.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/index.html 2016-11-29 15:44:04.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/index.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,186 +0,0 @@ - - - - - - - - Libmnemosyne overview — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

Libmnemosyne overview¶

-

Libmnemosyne consists of a number of components, which can be swapped in and -out. This is handled by the ComponentManager. Examples of components are the -scheduler, the storage layer, card types, plugins, ...

-

The basic unit of information from which Cards are derived is called a Fact, -containing a set of fields and their associated values. E.g., for a three-sided -CardType, these fields are foreign word, pronunciation and translation.

-

A FactView collects a number of the fields of a Fact into question and answers. -E.g., the three-sided CardType has a recognition FactView, where the question -contains the foreign word, and the answer contains the pronunciation and the -translation.

-

As mentioned before, a Fact is linked to a CardType, and each CardType lists -a set of FactViews.

-

The actual Cards are generated from the data in Fact using the recipe of a -certain FactView. A Card also contains all the repetition data needed for the -Scheduler to do its work. Since the question and answers are generated from -the Fact data each time a Card is shown, related Cards (i.e. Cards with -different FactViews of the same Fact) are always consistent.

-

The actual displaying of the data in a Card is handled by a RenderChain, which -details the operations needed to get from the raw data in a Card to a -representation of its question and answer, in a form either suitable for -displaying in a browser, or exporting to a text file, ... . First the raw data -is sent through Filters, which perform operations which can be useful for many -card types, like expanding relative paths. Then this data is assembled in the -right order in a Renderer, which can be card type specific.

-

At several points in the program, plugin writers can hook in their code using -the Hook mechanism.

-

Before the data is passed to the Renderer, Filters can be applied to it. This -is an extra level of flexibility, and can be used to generate LaTeX, convert -relative paths to absolute paths, etc ...

-

To determine which cards are active (i.e.) participate in the review process, -a mechanism of ActivityCriterion and CriterionApplier is used.

-

In order to make it easier for other GUI frontends to be written, all the logic -typically needed for GUIs, but that is independent of the actual GUI toolkit -used, is abstracted in controllers. In order to get more flexibility, there -are two of them: one related to the review process (which is different for -different schedulers), and one related to the rest of the program (which -normally won’t change).

-

There is also mechanism for plugins to add new statistical data to the standard -statistics in an integrated way.

-
- -
-

Indices and tables¶

- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/card.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/card.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/card.html 2016-10-24 11:19:12.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/card.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,160 +0,0 @@ - - - - - - - - Card — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

Card¶

-
-
-class mnemosyne.libmnemosyne.card.Card(card_type, fact, fact_view, creation_time=None)¶
-

A card has a question and an answer and also stores repetition data.

-

Questions and answers are dynamically generated depending on the card -type. Different render chains are supported, to e.g. render the question -for use in the review window, in the card browser, ... .

-

Creation and modification dates are POSIX timestamps stored as integers.

-

For card types which need extra information (e.g. cloze deletion), the -variable ‘extra_data’ can be used to store this extra information in the -database. It’s dictionary which should contain only standard Python -objects.

-

‘scheduler_data’ is a variable that can be used by a scheduler to save -state. It is an integer as opposed to a complex datatype to to allow for -fast sql queries. If a scheduler needs additional data, it can be stored -in ‘extra_data’, but then the custom scheduler needs to make sure it -explicitly logs an ‘edited_card’ event so that ‘extra data’ gets sent -across during sync.

-

‘active’ is used to determine whether a card is included in the review -process. Currently, the UI allows setting cards as active if they belong to -certain card type/fact view combos. We choose to store this information on -card level and not as a flag in fact view or tag, so that plugins have the -possibility to offer more flexibility, e.g. by having cards active based -on grade, ...

-

‘id’ is used to identify this object to the external world (logs, xml -files, sync, ...), whereas ‘_id’ is an internal id that could be different -and that can be used by the database for efficiency reasons.

-
-
-answer(render_chain='default', **render_args)¶
-
- -
-
-question(render_chain='default', **render_args)¶
-
- -
-
-reset_learning_data()¶
-

Used when creating a card for the first time, or when choosing -‘reset learning data’ on import.

-

‘acq_reps’ and ‘ret_reps’ are the number of repetitions this card has -seen in the acquisition phase (grade 0 and 1) and the retention phase -(grades 3 through 5) respectively.

-

‘lapses’ is the number of times a card with grade 2 or higher was -forgotten, i.e. graded 0 or 1.

-

‘last_rep’ and ‘next_rep’ are integer POSIX timestamps. Since they have -a resolution in seconds, they accomodate plugins doing minute-level -scheduling. Storing them as int makes it very efficient in SQL.

-
- -
-
-tag_string()¶
-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/card_type_converter.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/card_type_converter.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/card_type_converter.html 2016-10-24 11:19:12.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/card_type_converter.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,127 +0,0 @@ - - - - - - - - CardTypeConverter — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

CardTypeConverter¶

-
-
-class mnemosyne.libmnemosyne.card_type_converter.CardTypeConverter(component_manager, **kwds)¶
-

Converts a set of sister cards to a new card type.

-

used_for = (old_type class, new_type class)

-

Note that the function of this class is NOT to edit the fact data behind -the cards, which is trivial and handled in the main controller, but -rather to delete, create or convert cards to make the transition to the -new card type.

-

‘correspondence’ {old_fact_key: new_fact_key} is the dictionary which -relates fact keys in the two card types, in order to determine in which -way cards should be created or deleted.

-

We return ‘new_cards’, ‘edited_cards’, ‘deleted_cards’ in order to be able -to handle them in the database storage.

-
-
-component_type = 'card_type_converter'¶
-
- -
-
-convert(cards, old_card_type, new_card_type, correspondence)¶
-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/card_type.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/card_type.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/card_type.html 2016-10-24 11:19:12.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/card_type.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,241 +0,0 @@ - - - - - - - - CardType — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

CardType¶

-
-
-class mnemosyne.libmnemosyne.card_type.CardType(component_manager, **kwds)¶
-

A card type groups a number of fact views on a certain fact, thereby -forming a set of sister cards.

-

A card type needs an id as well as a name, because the name can change -for different translations.

-

Inherited card types should have ids where :: separates the different -levels of the hierarchy, e.g. parent_id::child_id.

-

The keys from the fact are also given more verbose names here. This is -not done in fact.py, on one hand to save space in the database, and on -the other hand to allow the possibility that different card types give -different names to the same key. (E.g. foreign word’ could be called -‘French’ in a French card type, or ‘pronunciation’ could be called -‘reading’ in a Kanji card type.) This is done in self.fact_keys_and_names, -which is a list of the form [(fact_key, fact_key_name)]. It is tempting -to use a dictionary here, but we can’t do that since ordering is -important.

-

Keys which need to be different for all facts belonging to this card -type are listed in ‘unique_fact_keys’.

-

Note that a fact could contain more data than those listed in the card -type’s ‘fact_keys_and_names’ variable, which could be useful for card -types needing hidden keys, dynamically generated keys, ... .

-

The functions ‘create_sister_cards’ and ‘edit_fact’ can be overridden by -card types which can have a varying number of fact views, e.g. the cloze -card type.

-
-
-component_type = 'card_type'¶
-
- -
-
-create_sister_cards(fact)¶
-

Initial grading of cards and storing in the database should not -happen here, but is done in the main controller.

-
- -
-
-edit_fact(fact, new_fact_data)¶
-

If for the card type this operation results in edited, added or -deleted card data apart from the edited fact data from which they -derive, these should be returned here, so that they can be taken into -account in the database storage.

-

Initial grading of cards and storing in the database should not happen -here, but is done in the main controller.

-
- -
-
-extra_data = {}¶
-
- -
-
-fact_data(card)¶
-

Returns the data in fact of a card. Normally. this is just -‘card.fact.data’, but specialty card types (e.g. the cloze card type) -can override this.

-
- -
-
-fact_key_format_proxies()¶
-

Sometimes, a card type can dynamically create a key when -generating a question or an answer (see e.g. the cloze card type). -Since the user cannot specify how this key should be formatted, it -should be formatted like an other, static key. This function returns -a dictionary with this correspondence.

-
- -
-
-fact_key_names()¶
-
- -
-
-fact_key_with_name(name)¶
-
- -
-
-fact_keys()¶
-
- -
-
-fact_keys_and_names = None¶
-
- -
-
-fact_views = None¶
-
- -
-
-id = '-1'¶
-
- -
-
-is_fact_data_valid(fact_data)¶
-

Check if all the required keys are present.

-
- -
-
-keyboard_shortcuts = {}¶
-
- -
-
-name = ''¶
-
- -
-
-render_answer(card, render_chain='default', **render_args)¶
-
- -
-
-render_question(card, render_chain='default', **render_args)¶
-
- -
-
-required_fact_keys = None¶
-
- -
-
-unique_fact_keys = None¶
-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/component.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/component.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/component.html 2016-10-24 11:19:12.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/component.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,258 +0,0 @@ - - - - - - - - Component — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

Component¶

-
-
-class mnemosyne.libmnemosyne.component.Component(component_manager, **kwds)¶
-

Base class of components that are registered with the component -manager. This is a list of component types: config, log, database, -scheduler, stopwatch, translator, card_type, card_type_converter, -render_chain, renderer, filter, card_type_widget, -generic_card_type_widget, ui_component, controller, main_widget, -review_controller, review_widget, file format, plugin, hook, -criterion, criterion_applier, statistics_page, sync_server, -all the abstract dialogs, ...

-

‘used_for’ can store certain relationships between components, e.g. -a card type widget is used for a certain card type.

-

Most of the time, instances are stored here, apart from widgets in which -case classes are stored. (Instantiating a complex widget can take a lot of -time on a mobile device, and should be done lazily.) Only the main -widget is stored as an instance here.

-

When ‘instantiate == LATER’, the component is lazily created when needed. -The instance is not cached for subsequent reuse, as these widgets -typically can become obsolete/overwritten by plugins.

-

Each component has access to all of the context of the other components -because it hold a reference to the user’s component manager.

-

We need to pass the context of the component manager already in the -constructor, as many component make use of it in their __init__ method. -This means that derived components should always call the -Component.__init__ if they provide their own constructor.

-
-
-IMMEDIATELY = 0¶
-
- -
-
-LATER = 1¶
-
- -
-
-activate()¶
-

Initialisation code called when the component is about to do actual -work, and which can’t happen in the constructor, e.g. because -components on which it relies have not yet been registered.

-
- -
-
-card_type_with_id(id)¶
-
- -
-
-card_types()¶
-
- -
-
-component_type = ''¶
-
- -
-
-config()¶
-
- -
-
-controller()¶
-
- -
-
-database()¶
-
- -
-
-deactivate()¶
-
- -
-
-flush_sync_server()¶
-

If there are still dangling sessions (i.e. those waiting in vain -for more client input) in the sync server, we should flush them and -make sure they restore from backup before doing anything that could -change the database (e.g. adding a card). Otherwise, if these -sessions close later during program shutdown, their backup -restoration will override the changes.

-

Also stop any running media.

-
- -
-
-instantiate = 0¶
-
- -
-
-log()¶
-
- -
-
-main_widget()¶
-
- -
-
-plugins()¶
-
- -
-
-render_chain(id='default')¶
-
- -
-
-review_controller()¶
-
- -
-
-review_widget()¶
-

Apart from the main widget, we create all other widgets lazily for -efficiency reasons. The review widget instance is therefore not stored -in the component manager, but is under the control of the review -controller.

-
- -
-
-scheduler()¶
-
- -
-
-start_review()¶
-
- -
-
-stopwatch()¶
-
- -
-
-translator()¶
-
- -
-
-used_for = None¶
-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/component_manager.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/component_manager.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/component_manager.html 2016-11-28 15:59:51.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/component_manager.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,157 +0,0 @@ - - - - - - - - ComponentManager — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

ComponentManager¶

-
-
-class mnemosyne.libmnemosyne.component_manager.ComponentManager¶
-

Manages the different components. Typically, instances of the different -components are stored, as opposed to classes. In such a way, the component -manager stores all the state of the user. Exceptions are widgets other -than the main widget, which are lazily created for efficiency reasons.

-

For certain components, many can be active at the same time (card types, -filters, function hooks, ...). For others, there can be only on active -at the same time, like schedule, database ... The idea is that the last -one registered takes preference. This means that e.g. the default -scheduler needs to be registered first.

-
-
-add_component_to_plugin(plugin_class_name, component_class)¶
-

Typical use case for this is when a plugin has a GUI component -which obviously does not live inside libmnemosyne, and which needs to -be added at a later stage.

-
- -
-
-all(comp_type, used_for=None)¶
-

For components for which there can be many active at once.

-
- -
-
-current(comp_type, used_for=None)¶
-

For components for which there can be only one active at any -time.

-
- -
-
-deactivate_all()¶
-
- -
-
-debug(msg)¶
-

Log a debugging message if debugging is enabled.

-
- -
-
-register(component)¶
-
- -
-
-unregister(component)¶
-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/configuration.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/configuration.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/configuration.html 2016-11-11 16:54:44.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/configuration.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,188 +0,0 @@ - - - - - - - - Configuration — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

Configuration¶

-
-
-class mnemosyne.libmnemosyne.configuration.Configuration(component_manager)¶
-
-
-activate()¶
-
- -
-
-card_type_property(property_name, card_type, fact_key=None, default=None)¶
-
- -
-
-change_user_id(new_user_id)¶
-

When a client syncs for the first time with a server, we need to -set the client’s user_id identical to the one of the server, in order -for the uploaded anonymous logs to be consistent.

-
- -
-
-clone_card_type_properties(old_card_type, new_card_type)¶
-
- -
-
-component_type = 'config'¶
-
- -
-
-delete_card_type_properties(card_type)¶
-
- -
-
-determine_dirs()¶
-
- -
-
-fill_dirs()¶
-

Fill data_dir and config_dir. Do this even if they already exist, -because we might have added new files since the last version.

-
- -
-
-load()¶
-
- -
-
-load_user_config()¶
-
- -
-
-machine_id()¶
-
- -
-
-save()¶
-
- -
-
-set_card_type_property(property_name, property_value, card_type, fact_key=None)¶
-

Set a property (like font, colour, ..) for a certain card type. -If fact_key is None, then this will be applied to all fact keys.

-

This info is not stored in the database, but in the configuration, -to allow different clients to have different settings, even though -they exchange data during sync.

-
- -
-
-set_defaults()¶
-

Fill the config with default values. Is called after every load, -since a new version of Mnemosyne might have introduced new keys.

-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/controller.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/controller.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/controller.html 2016-10-24 11:19:13.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/controller.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,287 +0,0 @@ - - - - - - - - Controller — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

Controller¶

-
-
-class mnemosyne.libmnemosyne.controller.Controller(component_manager, **kwds)¶
-

A collection of logic used by the GUI. The logic related to the -review process is split out in a separated controller class, to -allow that to be swapped out easily.

-

There are two classes of functions here: ‘show_XXX_dialog’, which needs -to be called by the GUI to set everything up to show a certain dialog, -and then the other functions, which the implementation of the actual -dialog can use to perform GUI-independent operations.

-

See also ‘How to write a new frontend’ in the docs.

-
-
-change_card_type(facts, old_card_type, new_card_type, correspondence)¶
-

Note: all facts should have the same card type.

-
- -
-
-clone_card_type(card_type, clone_name)¶
-
- -
-
-component_type = 'controller'¶
-
- -
-
-create_new_cards(fact_data, card_type, grade, tag_names, check_for_duplicates=True, save=True)¶
-
- -
-
-delete_card_type(card_type)¶
-
- -
-
-delete_current_card()¶
-
- -
-
-delete_facts_and_their_cards(facts)¶
-
- -
-
-delete_plugin(plugin)¶
-
- -
-
-edit_card_and_sisters(card, new_fact_data, new_card_type, new_tag_names, correspondence)¶
-
- -
-
-heartbeat()¶
-

For code that needs to run periodically.

-
- -
-
-install_plugin()¶
-
- -
-
-save_file()¶
-
- -
-
-show_add_cards_dialog()¶
-
- -
-
-show_browse_cards_dialog()¶
-
- -
-
-show_configuration_dialog()¶
-
- -
-
-show_edit_card_dialog()¶
-
- -
-
-show_export_file_dialog()¶
-
- -
-
-show_getting_started_dialog()¶
-
- -
-
-show_import_file_dialog()¶
-
- -
-
-show_insert_img_dialog(filter)¶
-

Filter contains the file dialog filter with the supported -filetypes.

-
- -
-
-show_insert_sound_dialog(filter)¶
-

Filter contains the file dialog filter with the supported -filetypes.

-
- -
-
-show_insert_video_dialog(filter)¶
-

Filter contains the file dialog filter with the supported -filetypes.

-
- -
-
-show_manage_card_types_dialog()¶
-
- -
-
-show_manage_plugins_dialog()¶
-
- -
-
-show_new_file_dialog()¶
-
- -
-
-show_open_file_dialog()¶
-
- -
-
-show_save_file_as_dialog()¶
-
- -
-
-show_statistics_dialog()¶
-
- -
-
-show_sync_dialog()¶
-
- -
-
-show_tip_dialog()¶
-
- -
-
-star_current_card()¶
-
- -
-
-sync(server, port, username, password, ui=None)¶
-
- -
-
-update_title()¶
-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/criterion.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/criterion.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/criterion.html 2016-10-24 11:19:13.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/criterion.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,226 +0,0 @@ - - - - - - - - Criterion — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

Criterion¶

-
-
-class mnemosyne.libmnemosyne.criterion.Criterion(component_manager, id=None)¶
-

Used to select a subset of cards, e.g. which cards are currently -active, i.e. included in the review process.

-

The available criteria are stored as classes in the component_manager, -the actual instances together with their data are stored in the database.

-
-
-active_card_type_added(card_type)¶
-
- -
-
-active_tag_added(tag)¶
-
- -
-
-apply_to_card(card)¶
-

Set the card active or not depending on the criterion. Does not -write to the database. Called e.g. after creating, updating or -reviewing cards, to see whether these cards should start out their -life as active or not.

-

The tag and card type creation and deletion functions are callbacks -called by the rest of libmnemosyne when these objects get created or -destroyed, such that Criteria can update their status if needed.

-
- -
-
-card_type_deleted(card_type)¶
-
- -
-
-component_type = 'criterion'¶
-
- -
-
-criterion_type = ''¶
-
- -
-
-data_to_string()¶
-

Convert variables to a string for storage in the database. We don’t -use pickle here as that would make it difficult for non-Python programs -to read the database.

-
- -
-
-data_to_sync_string()¶
-

Convert variables to a string for sending across during syncing. -Could be different from ‘data_to_string’, as it should use ids instead -of _ids.

-
- -
-
-deactivated_card_type_added(card_type)¶
-
- -
-
-deactivated_tag_added(tag)¶
-
- -
-
-instantiate = 1¶
-
- -
-
-is_empty()¶
-

Used to prevent people from creating a criterion which can never -contain any cards (e.g. disabling all card types).

-
- -
-
-is_tag_active(tag)¶
-
- -
-
-set_data_from_string(data_string)¶
-
- -
-
-set_data_from_sync_string(data_string)¶
-
- -
-
-tag_deleted(tag)¶
-
- -
- -
-
-class mnemosyne.libmnemosyne.criterion.CriterionApplier(component_manager, **kwds)¶
-

Can be registered ‘used_for’ a certain Criterion to apply it in bulk to -all the cards in the database. Is much faster than fetching each card from -the database, calling Criterion.apply_to_card, and storing it back in the -database.

-

This code is not part of Criterion, because it is dependent on the database -backend.

-
-
-apply_to_database(criterion)¶
-
- -
-
-component_type = 'criterion_applier'¶
-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/database.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/database.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/database.html 2016-10-24 11:19:13.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/database.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,514 +0,0 @@ - - - - - - - - Database — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

Database¶

-
-
-class mnemosyne.libmnemosyne.database.Database(component_manager, **kwds)¶
-

Interface class describing the functions to be implemented by the -actual database classes.

-

Apart from the basic interface defined here, depending on the situation -a database can also implement functions for logging, statistics and -syncing (see SQLite_logging.py, SQLite_statistics.py, SQLite_sync.py).

-
-
-abandon()¶
-
- -
-
-add_card(card)¶
-
- -
-
-add_card_type(card_type)¶
-
- -
-
-add_criterion(criterion)¶
-
- -
-
-add_fact(fact)¶
-
- -
-
-add_fact_view(fact_view)¶
-
- -
-
-add_tag(tag)¶
-
- -
-
-add_tag_to_cards_with_internal_ids(tag, _card_ids)¶
-
- -
-
-backup()¶
-
- -
-
-card(id, is_id_internal)¶
-
- -
-
-card_type(id, is_id_internal)¶
-
- -
-
-card_types_in_use()¶
-
- -
-
-cards(sort_key='', limit=-1)¶
-
- -
-
-cards_due_for_ret_rep(now, sort_key='', limit=-1)¶
-
- -
-
-cards_from_fact(fact)¶
-

Return a list of the cards deriving from a fact.

-
- -
-
-cards_learn_ahead(now, sort_key='', limit=-1)¶
-
- -
-
-cards_new_memorising(grade, sort_key='', limit=-1)¶
-
- -
-
-cards_to_relearn(grade, sort_key='', limit=-1)¶
-
- -
-
-cards_unseen(sort_key='', limit=-1)¶
-
- -
-
-cards_with_scheduler_data(scheduler_data, sort_key='', limit=-1)¶
-
- -
-
-change_user_id(user_id)¶
-
- -
-
-component_type = 'database'¶
-
- -
-
-criteria()¶
-
- -
-
-criterion(id, is_id_internal)¶
-
- -
-
-current_criterion()¶
-
- -
-
-data_dir()¶
-

Returns directory of the database.

-
- -
-
-deactivate()¶
-
- -
-
-default_criterion_name = '__DEFAULT__'¶
-
- -
-
-default_name = 'default'¶
-
- -
-
-delete_card(card)¶
-
- -
-
-delete_card_type(card_type)¶
-
- -
-
-delete_criterion(criterion)¶
-
- -
-
-delete_fact(fact)¶
-
- -
-
-delete_fact_view(fact_view)¶
-
- -
-
-delete_tag(tag)¶
-
- -
-
-delete_tag_if_unused(tag)¶
-
- -
-
-display_name()¶
-

Returns bare name of the database, without parent paths and -without extension.

-
- -
-
-duplicates_for_fact(fact, card_type)¶
-

Return facts with same ‘card_type.unique_fact_keys’ data as ‘fact’.

-
- -
-
-fact(id, is_id_internal)¶
-
- -
-
-fact_view(id, is_id_internal)¶
-
- -
-
-get_or_create_tag_with_name(name)¶
-
- -
-
-get_or_create_tags_with_names(names)¶
-
- -
-
-has_card_type_with_id(id)¶
-
- -
-
-has_card_with_id(id)¶
-
- -
-
-has_clone(card_type)¶
-
- -
-
-has_criterion_with_id(id)¶
-
- -
-
-has_fact_view_with_id(id)¶
-
- -
-
-has_fact_with_id(id)¶
-
- -
-
-has_tag_with_id(id)¶
-
- -
-
-is_empty()¶
-
- -
-
-is_in_use(card_type)¶
-
- -
-
-is_loaded()¶
-
- -
-
-is_user_card_type(card_type)¶
-
- -
-
-load(path)¶
-
- -
-
-name()¶
-

Returns name of the database, without parent paths, but with -extensions.

-
- -
-
-new(path)¶
-
- -
-
-path()¶
-

Returns full path of the database.

-
- -
-
-release_connection()¶
-

Release the connection, so that it may be recreated in a separate -thread.

-
- -
-
-remove_tag_from_cards_with_internal_ids(tag, _card_ids)¶
-
- -
-
-restore(path)¶
-
- -
-
-save(path=None)¶
-
- -
-
-scheduler_data_count(scheduler_data)¶
-
- -
-
-set_current_criterion(criterion)¶
-
- -
-
-set_scheduler_data(scheduler_data)¶
-
- -
-
-sorted_card_types()¶
-

Sorts card types so that all the built-in card types appear first, -in the order determined by their id, and then all the user card types -appear alphabetically.

-
- -
-
-suffix = ''¶
-
- -
-
-tag(id, is_id_internal)¶
-
- -
-
-tags()¶
-
- -
-
-tags_from_cards_with_internal_ids(_card_ids)¶
-
- -
-
-unload()¶
-
- -
-
-update_card(card, repetition_only=False)¶
-
- -
-
-update_card_type(card_type)¶
-
- -
-
-update_criterion(criterion)¶
-
- -
-
-update_fact(fact)¶
-
- -
-
-update_fact_view(fact_view)¶
-
- -
-
-update_tag(tag)¶
-
- -
-
-user_id()¶
-
- -
-
-version = ''¶
-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/fact.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/fact.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/fact.html 2016-10-24 11:19:13.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/fact.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,139 +0,0 @@ - - - - - - - - Fact — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

Fact¶

-
-
-class mnemosyne.libmnemosyne.fact.Fact(data, id=None)¶
-

Basic unit of information from which several cards can be derived.

-

The fields are stored in a dictionary called ‘data’, and can be get and -set using the standard dictionary syntax.

-

‘id’ is used to identify this object to the external world (logs, xml -files, sync, ...), whereas ‘_id’ is an internal id that could be different -and that can be used by the database for efficiency reasons.

-

The keys in data should not contain characters like <, >, &, ..., as they -are used as unescaped tag names during sync.

-

When making new card types, it is best to reuse the keys below as much -as possible, to facilitate conversion between card types:

- ---- - - - - - - - - - - - - - - - - - -
ffront
bback
fforeign word
p_1pronunciation
m_1meaning
-
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/fact_view.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/fact_view.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/fact_view.html 2016-10-24 11:19:13.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/fact_view.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ - - - - - - - - FactView — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

FactView¶

-
-
-class mnemosyne.libmnemosyne.fact_view.FactView(name, id)¶
-

Sequence of keys from a fact to form a question and an answer. -A fact view needs an id string as well as a name, because the name can -change for different translations.

-

Note that id’s should be unique to distinguish them during sync, so a -good naming convention is ‘card_type_id.fact_view_id’. (We don’t use -‘::’ so as not to interfere with the ‘::’ in inherited card types.)

-

The purpose of the decorator dictionaries is to allow for cards that read -‘What is the answer to $question’, as opposed to just ‘$question’.

-
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/file_format.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/file_format.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/file_format.html 2016-10-24 11:19:13.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/file_format.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,142 +0,0 @@ - - - - - - - - FileFormat — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

FileFormat¶

-
-
-class mnemosyne.libmnemosyne.file_format.FileFormat(component_manager, **kwds)¶
-
-
-component_type = 'file_format'¶
-
- -
-
-description = ''¶
-
- -
-
-do_import(filename, extra_tag_name=None)¶
-

Make sure fileformats call this implementation first.

-
- -
-
-export_possible = False¶
-
- -
-
-extension = ''¶
-
- -
-
-filename_filter = ''¶
-
- -
-
-import_possible = False¶
-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/filter.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/filter.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/filter.html 2016-10-24 11:19:13.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/filter.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,123 +0,0 @@ - - - - - - - - Filter — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

Filter¶

-
-
-class mnemosyne.libmnemosyne.filter.Filter(component_manager, **kwds)¶
-

Code which operates on a string and filters it to achieve extra -functionality, e.g. converting relative paths to absolute paths.

-

It is contained in a RenderChain and represents functionality which is -useful for many different card types.

-

The filters are executed in the order they are listed in the RenderChain. -If you really need to make sure that your filter runs before the -rest, set ‘in_front=True’ as argument in ‘render_chain.register_filter’.

-
-
-component_type = 'filter'¶
-
- -
-
-run(text, card, fact_key, **render_args)¶
-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/hook.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/hook.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/hook.html 2016-10-24 11:19:13.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/hook.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,164 +0,0 @@ - - - - - - - - Hook — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

Hook¶

-
-
-class mnemosyne.libmnemosyne.hook.Hook(component_manager, **kwds)¶
-

Function hooks are used by registering an instance of this class as -component of type hook, with the ‘used_for’ argument any of the following -hook points:

-
-
---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
‘after_load’in database.load
‘after_backup’in database.backup
‘before_unload’in database.unload
‘configuration_defaults’in configuration.set_defaults
‘before_repetititon’in SM2_mnemosyne.grade_answer -extra argument: card
‘after_repetititon’in SM2_mnemosyne.grade_answer -extra argument: card
‘dynamically_create_media_files’in SQLite_sync -extra argument: data
‘delete_unused_media_files’in SQLite_sync
‘preprocess_cloze’in cloze.py
‘postprocess_q_a_cloze’in cloze.py
-
-

It is the ‘run’ method that will get called at the corresponding point -in the program.

-
-
-component_type = 'hook'¶
-
- -
-
-run()¶
-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/how_to_write_a_new_frontend.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/how_to_write_a_new_frontend.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/how_to_write_a_new_frontend.html 2016-10-24 11:19:13.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/how_to_write_a_new_frontend.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,176 +0,0 @@ - - - - - - - - How to write a new frontend — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

How to write a new frontend¶

-

libmnemosyne is designed in such a way that writing a new front is as painless as possible. All the code for running a GUI which is actually GUI toolkit independent is grouped in two controllers: the main ui controller and the review ui controller. In order to build a new frontend, you need to create a main widget which inherits from MainWidget and implements its interface, and similarly a review widget which inherits from ReviewWidget.

-

In order to get a feel for how this works, it’s best by starting to study the code for the ppygui_ui Windows Mobile client, which is the simplest possible frontend, as it only supports reviewing cards.

-

There are three files in that frontend:

-
    -
  • a startup script, which specifies which components your frontend wants to activate in libmnemosyne, whether you are running on a device which is resource limited, ... .
  • -
  • a main widget, which corresponds to the application level widget in the GUI toolkit, and is in charge of showing error dialogs, displaying menus.
  • -
  • the review widget, where you need to implement a.o. the code to display text in the question window, ... .
  • -
-

To give a better feeling for how the division of labour between your own new GUI code and the GUI independent code in the controllers works, consider this example from the ‘add cards’ functionality in the PyQt frontend.

-

When the user activates the menu option or icon to add cards, it will fire up a certain function, which in the PyQt frontend is called add_cards():

-
QObject.connect(self.actionAddCards, SIGNAL("activated()"), MainWindow.add_cards)
-
-
-

The implementation of this function is rather trivial, it just calls the controller:

-
def add_cards(self):
-    self.controller().show_add_cards_dialog()
-
-
-

The code above is code you need to implement for your new frontend, but as you can see, it’s rather trivial.

-

The controller’s show_add_cards_dialog function looks like this:

-
def show_add_cards_dialog(self):
-    self.stopwatch().pause()
-    self.component_manager.get_current("add_cards_dialog")\
-        (self.component_manager).activate()
-    review_controller = self.review_controller()
-    review_controller.reload_counters()
-    if review_controller.card is None:
-        review_controller.new_question()
-    else:
-        review_controller.update_status_bar()
-    self.stopwatch().unpause()
-
-
-

This is where the heavy lifting is done, but it’s completely UI independent, and there should be no need for you to modify that code.

-

In order for the controller to know where it can find the actual add cards dialog, which for PyQt is called AddCardsDlg , you need to have that dialog derive from the abstract libmnemosyne.ui_components.dialogs.AddCardsDialog, and provide an activate function, which for the PyQt toolkit is simply:

-
def activate(self):
-    self.exec_()
-
-
-

Finally, you need to register the AddCardsDlg component. That is what the following line does inside the main startup script (which for PyQt is simply called mnemosyne):

-
mnemosyne.components.append(("mnemosyne.pyqt_ui.add_cards_dlg",
-                             "AddCardsDlg"))
-
-
-

Inside the AddCardsDlg, there is of course lots of UI specific code, but once the dialog has enough data to create the cards, it simply calls:

-
self.controller().create_new_cards(fact_data, card_type, grade, tag_names)
-
-
-

So, the AddCardsDlg should almost entirely consist of GUI dependent code. All the GUI indepedent code to actually create the cards is contained within the controller’s create_new_cards() method.

-

If you feel like you need to override the review or the main controller provided by libmnemosyne, please let the developpers know. Either its design is not general enough, or you are trying to work against libmnemosyne rather than with it.

-

Tips for creating a responsive client:

-
    -
  • When instantiating a libmnemosyne.Mnemosyne object, there are two parameters you need to provide: upload_science_logs and interested_in_old_reps. If you are writing a mobile client which syncs to a desktop version of mnemosyne, it is recommended that you don’t deal with uploading the science logs yourself, but let the desktop client deal with that. As for interested_in_old_reps, if your mobile client does not include graphical statistics using the revision history, it does not make sense to store this history on your device.

    -
  • -
  • The standard instantiation of a libmnemosyne.Mnemosyne object includes all components in libmnemosyne. If you are writing a mobile client with e.g. only review capabilities, it does not make sense to include all these components. See the example of the Windows Mobile ppygui_ui frontend for a client which only uses the bare minimum of components to improve startup time.

    -
  • -
  • If your mobile client does not include a card browser, you can save some disk space by not storing pregenerated questions or answers. To achieve this, make sure you do not include the regular SQLite component, but this one:

    -
    ("mnemosyne.libmnemosyne.databases.SQLite_no_pregenerated_data",
    - "SQLite_NoPregeneratedData")
    -
    -
    -
  • -
  • libmnemosyne does some optimisation by trying to show the next question before the grading of the previous question is completed. This improves the perceived responsiveness of the client. However, some GUI toolkits (e.g. Qt) queue widget updates and only excecute them when there is no more processing going on, thereby defeating libmnemosyne’s optimisation. For that reason, there is a function review_widget().redraw_now which is used to tell the GUI toolkit to do the repaint now. If your toolkit also has similar behaviour, implementing this function can really help to mask slow database access.

    -
  • -
  • If save operations are slow on your mobile device, you might want to consider setting a larger default value instead of save_after_n_reps = 1 in config.py.

    -
  • -
  • If media files will never be edited outside of Mnemosyne on your mobile device, you can save time during sync by setting check_for_updated_media_files = False in config.py.

    -
  • -
  • If you are really adventurous, you can set backup_before_sync = True in config.py.

    -
  • -
-

Notes:

-
    -
  • If you need access to the main widget when you are constructing the review widget, e.g. to specify it’s parent, you can access it using self.main_widget()`
  • -
  • If you need access to some components of libmnemosyne to construct your widget (e.g. the configuration), these might not yet be available inside your __init__() method. In this case, you need to move that code to your widget’s activate() method, at which time all the other compoments will already be active.
  • -
  • Everything described here applies not only for Python frontends, but also for frontends not written in Python, which access libmnemosyne through an UDP socket or through the Python-embedded-in-C bridge.
  • -
-
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/logger.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/logger.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/logger.html 2016-11-28 15:59:51.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/logger.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,311 +0,0 @@ - - - - - - - - Logger — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

Logger¶

-
-
-class mnemosyne.libmnemosyne.logger.Logger(component_manager)¶
-
-
-activate()¶
-
- -
-
-added_card(card)¶
-
- -
-
-added_card_type(card_type)¶
-
- -
-
-added_criterion(criterion)¶
-
- -
-
-added_fact(fact)¶
-
- -
-
-added_fact_view(fact_view)¶
-
- -
-
-added_media_file(filename)¶
-
- -
-
-added_tag(tag)¶
-
- -
-
-archive_old_log()¶
-

Archive log to history folder if it’s large enough.

-
- -
-
-component_type = 'log'¶
-
- -
-
-deactivate()¶
-
- -
-
-deleted_card(card)¶
-
- -
-
-deleted_card_type(card_type)¶
-
- -
-
-deleted_criterion(criterion)¶
-
- -
-
-deleted_fact(fact)¶
-
- -
-
-deleted_fact_view(fact_view)¶
-
- -
-
-deleted_media_file(filename)¶
-
- -
-
-deleted_tag(tag)¶
-
- -
-
-dump_to_science_log()¶
-
- -
-
-edited_card(card)¶
-
- -
-
-edited_card_type(card_type)¶
-
- -
-
-edited_criterion(criterion)¶
-
- -
-
-edited_fact(fact)¶
-
- -
-
-edited_fact_view(fact_view)¶
-
- -
-
-edited_media_file(filename)¶
-
- -
-
-edited_setting(key)¶
-
- -
-
-edited_tag(tag)¶
-
- -
-
-get_timestamp()¶
-

If self._timestamp == None (the default), then the timestamp will -be the current time. It is useful to be able to override this, e.g. -during database import or syncing, when you need to add log entries -to the database that happened in the past.

-
- -
-
-loaded_database(machine_id=None, scheduled_count=None, non_memorised_count=None, active_count=None)¶
-
- -
-
-log_index_of_last_upload()¶
-

We don’t store this info in the configuration, but determine it on -the fly, so that users can copy configuration files between their -machines.

-

1.x log names have the format userid_index.bz2. -2.x log names have the format userid_machineid_index.bz2

-

Obviously, we should only consider the logs from our own machine.

-
- -
-
-repetition(card, scheduled_interval, actual_interval, thinking_time)¶
-
- -
-
-saved_database(machine_id=None, scheduled_count=None, non_memorised_count=None, active_count=None)¶
-
- -
-
-set_timestamp(timestamp)¶
-
- -
-
-start_logging()¶
-
- -
-
-started_program(version_string=None)¶
-
- -
-
-started_scheduler(scheduler_name=None)¶
-
- -
-
-stopped_program()¶
-
- -
-
-timestamp¶
-

If self._timestamp == None (the default), then the timestamp will -be the current time. It is useful to be able to override this, e.g. -during database import or syncing, when you need to add log entries -to the database that happened in the past.

-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/log_uploader.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/log_uploader.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/log_uploader.html 2016-10-24 11:19:13.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/log_uploader.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ - - - - - - - - LogUploader — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

LogUploader¶

-
-
-class mnemosyne.libmnemosyne.log_uploader.LogUploader(component_manager)¶
-
-
-run()¶
-
- -
-
-upload(filename)¶
-

Upload a single file to our serverside CGI script. -Based on code by Jeff Bauer, Aaron Watters, Jim Fulton.

-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/plugin.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/plugin.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/plugin.html 2016-11-29 15:44:04.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/plugin.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,147 +0,0 @@ - - - - - - - - Plugin — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

Plugin¶

-
-
-class mnemosyne.libmnemosyne.plugin.Plugin(component_manager)¶
-

A Plugin is a group of components which can be activated and -deactivated by the user when the program is running.

-

Plugins are used as a separate class, and not as mixins, in order to -allow for the fact that a Plugin can group multiple components.

-

‘components’ is a list of component classes (not instances) that will -be registered and/or instantiated when the Plugin becomes active.

-

Activating and deactivating certain components needs to give rise to -certain side effects. It’s cumbersone to implement those in the -‘activate’ and ‘deactivate’ methods of the components, as these also -are called when the program is still starting up and the context can -be completely different. Therefore, they are handled here.

-
-
-activate()¶
-
- -
-
-component_type = 'plugin'¶
-
- -
-
-components = []¶
-
- -
-
-deactivate()¶
-
- -
-
-description = ''¶
-
- -
-
-name = ''¶
-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/render_chain.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/render_chain.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/render_chain.html 2016-10-24 11:19:14.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/render_chain.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,203 +0,0 @@ - - - - - - - - RenderChain — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

RenderChain¶

-
-
-class mnemosyne.libmnemosyne.render_chain.RenderChain(component_manager)¶
-

A RenderChain details the operations needed to get from the raw data -in a card to a representation of its question and answer, in a form either -suitable for displaying in a browser, or exporting to a text file, ... .

-

First the raw data is sent through Filters, which perform operations which -can be useful for many card types, like expanding relative paths.

-

Then this data is assembled in the right order in a Renderer, which can be -card type specific.

-

‘filters’: list of Filter classes -‘renderers’: list or Renderer classes

-

Plugins can add Filters or Renderers for a new card type to a chain at run -time.

-
-
-component_type = 'render_chain'¶
-
- -
-
-filter(filter_class)¶
-
- -
-
-filters = []¶
-
- -
-
-id = 'default'¶
-
- -
-
-register_filter(filter_class, in_front=False)¶
-

‘filter_class’ should be a class, not an instance.

-
- -
-
-register_filter_at_back(filter_class, before=[])¶
-

Register a filter at the back of the render chain, but before -a list of other filters already in the chain. The list should -contain class names. (Using strings instead of classes means a -plugin writer does not need to import the filters he wants to use -in this list.)

-

‘filter_class’ should be a class, not an instance.

-
- -
-
-register_filter_at_front(filter_class, after=[])¶
-

Register a filter at the very front of the render chain, but after -a list of other filters already in the chain. The list should -contain class names. (Using strings instead of classes means a -plugin writer does not need to import the filters he wants to use -in this list.)

-

‘filter_class’ should be a class, not an instance.

-
- -
-
-register_renderer(renderer_class)¶
-

‘renderer_class’ should be a class, not an instance.

-
- -
-
-render_answer(card, **render_args)¶
-
- -
-
-render_question(card, **render_args)¶
-
- -
-
-renderer_for_card_type(card_type)¶
-
- -
-
-renderers = []¶
-
- -
-
-unregister_filter(filter_class)¶
-

‘filter_class’ should be a class, not an instance.

-
- -
-
-unregister_renderer(renderer_class)¶
-

‘renderer_class’ should be a class, not an instance.

-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/renderer.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/renderer.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/renderer.html 2016-10-24 11:19:14.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/renderer.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,143 +0,0 @@ - - - - - - - - Renderer — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

Renderer¶

-
-
-class mnemosyne.libmnemosyne.renderer.Renderer(component_manager, **kwds)¶
-

Assembles a sequence of ‘fact_keys’ which are keys in a dictionary -‘fact_data’ to a certain format, e.g. a html page, or a purely text based -format.

-

Typically ‘fact_keys’ are the question and answer keys of the card’s fact -view.

-

It is contained in a RenderChain and represents the functionality which -is typically different for each card type.

-

If this renderer is only for a specific card type (and its descendants) -‘used_for’ can be set to the corresponding CardType class. If it is set to -None, this renderer is used for all other card types.

-
-
-component_type = 'renderer'¶
-
- -
-
-render(fact_data, fact_keys, card_type, **render_args)¶
-

Assembles a sequence of ‘fact_keys’ which are keys in a dictionary -‘fact_data’.

-

card_type’ is passed as extra argument e.g. to determine card type -specific formatting.

-
- -
-
-update(card_type)¶
-

Update renderer information for given card type. Some information -(e.g. css style sheets) is typically cached, and this function is -used to signal that the cache should be rebuilt.

-
- -
-
-used_for = None¶
-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/review_controller.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/review_controller.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/review_controller.html 2016-10-24 11:19:14.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/review_controller.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,195 +0,0 @@ - - - - - - - - ReviewController — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

ReviewController¶

-
-
-class mnemosyne.libmnemosyne.review_controller.ReviewController(component_manager)¶
-

Controls the behaviour of a widget which implements the ReviewWidget -interface.

-

The review controller is the one that should instantiate the review -widget, and only one needed. There could be many review widgets defined -in plugins, and instantiating them all when starting the program could be -slow, especially on a mobile device.

-
-
-component_type = 'review_controller'¶
-
- -
-
-counters()¶
-

Returns tuple (scheduled_count, non_memorised_count, active_count).

-
- -
-
-grade_answer(grade)¶
-

All the code that needs to run after the user grades the answer. -Note that this also incluse pulling in a new question.

-
- -
-
-is_answer_showing()¶
-
- -
-
-is_question_showing()¶
-
- -
-
-reload_counters()¶
-

To be called when counters need to be reloaded from the database.

-
- -
-
-reset()¶
-
- -
-
-reset_but_try_to_keep_current_card()¶
-

This is typically called after activities which invalidate the -current queue, like ‘Activate cards’ or ‘Configure’. For the best user -experience, we try to keep the card that is currently being asked if -possible.

-
- -
-
-set_render_chain(render_chain)¶
-
- -
-
-set_state(state)¶
-
- -
-
-show_answer()¶
-
- -
-
-show_new_question()¶
-
- -
-
-state()¶
-
- -
-
-update_dialog()¶
-
- -
-
-update_status_bar_counters()¶
-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/scheduler.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/scheduler.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/scheduler.html 2016-10-24 11:19:14.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/scheduler.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,222 +0,0 @@ - - - - - - - - Scheduler — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

Scheduler¶

-
-
-class mnemosyne.libmnemosyne.scheduler.Scheduler(component_manager, **kwds)¶
-
-
-active_count()¶
-
- -
-
-avoid_sister_cards(card)¶
-

Change card.next_rep to make sure that the card is not scheduled -on the same day as a sister card.

-

Factored out here to allow this to be used by e.g. MnemoGogo.

-
- -
-
-card_count_scheduled_n_days_from_now(n)¶
-

Yesterday: n=-1, today: n=0, tomorrow: n=1, ... .

-

Is not implemented in the database, because this could need internal -scheduler information.

-
- -
-
-component_type = 'scheduler'¶
-
- -
-
-grade_answer(card, new_grade, dry_run=False)¶
-
- -
-
-is_in_queue(card)¶
-

To check whether the queue needs to be rebuilt, e.g. if it contains -a card that was deleted in the GUI.

-
- -
-
-is_prefetch_allowed()¶
-

Can we display a new card before having processed the grading of -the previous one?

-
- -
-
-last_rep_to_interval_string(last_rep, now=None)¶
-

Converts last_rep to a string like ‘yesterday’, ‘2 weeks ago’, ...

-
- -
-
-name = ''¶
-
- -
-
-next_card(learn_ahead=False)¶
-
- -
-
-next_rep_to_interval_string(next_rep, now=None)¶
-

Converts next_rep to a string like ‘tomorrow’, ‘in 2 weeks’, ...

-
- -
-
-non_memorised_count()¶
-
- -
-
-rebuild_queue(learn_ahead=False)¶
-

Called by the rest of the library when an existing queue risks -becoming invalid, e.g. when cards have been deleted in the GUI. -‘next_card’ also makes use of this in certain implementations.

-
- -
-
-remove_from_queue_if_present(card)¶
-
- -
-
-reset()¶
-

Called when starting the scheduler for the first time.

-
- -
-
-scheduled_count()¶
-
- -
-
-set_initial_grade(cards, grade)¶
-

Sets the initial grades for a set of sister cards, making sure -their next repetitions do no fall on the same day.

-

Called when cards are given their initial grade outside of the -review process, e.g. when the user gives an initial grade when -adding a new card in the GUI. Therefore, ‘unseen’ is still left to -True, as this card has not yet been seen in the interactive review -process.

-

Cards which don’t have initial grade information available (e.g. for -cards created during import or conversion from different card type), -get their initial grade when they are encountered in the interactive -review process for the first time.

-

In both cases, this initial grading is seen as the first repetition.

-

In this way, both types of cards are treated in the same way. (There -is an ineffectual asymmetry left in the log messages they generate, -but all the relevant information can still be parsed from them.)

-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/statistics_page.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/statistics_page.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/statistics_page.html 2016-10-24 11:19:14.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/statistics_page.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,160 +0,0 @@ - - - - - - - - StatisticsPage — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

StatisticsPage¶

-
-
-class mnemosyne.libmnemosyne.statistics_page.StatisticsPage(component_manager)¶
-

A self-contained piece of statistical information, typically displayed -in the GUI as a page in a tabbed widget.

-

Each StatisticsPage can have several ‘variants’, e.g. displaying the -number of scheduled cards either for next week or for next month.

-

For each StatisticsPage, there will be an associated widget (plotting -widget, html browser, custom widget, ... ) that is in charge of displaying -the information. This widget needs to be registered in the component -manager as a ‘statistics_widget’ ‘used_for’ a particular StatisticsPage -(or a parent class of a StatisticsPage).

-
-
-component_type = 'statistics_page'¶
-
- -
-
-instantiate = 1¶
-
- -
-
-name = ''¶
-
- -
-
-prepare_statistics(variant_id)¶
-

This method calculates the data for the requested variant and sets -the approriate hints to be picked up by the corresponding widget.

-
- -
-
-show_variants_in_combobox = True¶
-
- -
-
-variants = []¶
-
- -
- -
-
-class mnemosyne.libmnemosyne.statistics_page.PlotStatisticsPage(component_manager)¶
-

A statistics page where the data is represented on a graphical plot.

-
- -
-
-class mnemosyne.libmnemosyne.statistics_page.HtmlStatisticsPage(component_manager)¶
-

A statistics page which generates html to displayed in a browser -widget.

-
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/stopwatch.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/stopwatch.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/stopwatch.html 2016-10-24 11:19:14.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/stopwatch.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,139 +0,0 @@ - - - - - - - - Stopwatch — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

Stopwatch¶

-
-
-class mnemosyne.libmnemosyne.stopwatch.Stopwatch(component_manager)¶
-

The main use of the stop watch is to measure the time it takes the user -to answer a question. ‘start_time’ is used to keep track of when the card -was first shown.

-
-
-component_type = 'stopwatch'¶
-
- -
-
-pause()¶
-
- -
-
-start()¶
-
- -
-
-stop()¶
-
- -
-
-time()¶
-
- -
-
-unpause()¶
-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/tag.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/tag.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/tag.html 2016-10-24 11:19:14.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/tag.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ - - - - - - - - Tag — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

Tag¶

-
-
-class mnemosyne.libmnemosyne.tag.Tag(name, id=None)¶
-

The tag name is the full name, including all levels of the hierarchy -separated by ::.

-

‘id’ is used to identify this object to the external world (logs, xml -files, sync, ...), whereas ‘_id’ is an internal id that could be -different and that can be used by the database for efficiency reasons.

-

Untagged cards are given the internal tag __UNTAGGED__, to allow for a -fast implementation of applying criteria.

-
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/tag_tree.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/tag_tree.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/modules/tag_tree.html 2016-10-24 11:19:14.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/modules/tag_tree.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,130 +0,0 @@ - - - - - - - - TagTree — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-

TagTree¶

-
-
-class mnemosyne.libmnemosyne.tag_tree.TagTree(component_manager)¶
-

Organises the tags in a hierarchical tree. By convention, hierarchical -levels in tags are denoted by a :: separator.

-

This class is not meant to be instantiated at run time, but rather only -when it is needed.

-

The internal tree datastructure for e.g. the two tags A::B::C and A::B::D -looks as follows:

-

self[_(“__ALL__”)] = [“A”] -self[“A”] = [“A::B”] -self[“A::B”] = [“A::B::C”, “A::B::D”]

-

Each tree level stores the entire partial tag (i.e. A::B instead of B) to -guarantee uniqueness.

-

Apart from the dictionary in self, this class also contains -self.display_name_for_node and self.card_count_for_node, with node being -the index field for the main dictionary self.

-
-
-delete_subtree(node)¶
-
- -
-
-rename_node(node, new_name)¶
-
- -
- -
- - -
-
-
- -
-
- - - - - - - \ No newline at end of file Binary files /tmp/tmpNoYn47/ajGK50spUe/mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/objects.inv and /tmp/tmpNoYn47/vW_aZbQ35_/mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/objects.inv differ diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/py-modindex.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/py-modindex.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/py-modindex.html 2016-11-29 15:44:05.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/py-modindex.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,230 +0,0 @@ - - - - - - - - Python Module Index — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/search.html mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/search.html --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/search.html 2016-11-29 15:44:05.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/search.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ - - - - - - - - Search — libmnemosyne 2.0 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -

Search

-
- -

- Please activate JavaScript to enable the search - functionality. -

-
-

- From here you can search these documents. Enter your search - words into the box below and click "search". Note that the search - function will automatically search for all of the words. Pages - containing fewer words won't appear in the result list. -

-
- - - -
- -
- -
- -
-
-
- -
-
- - - - - - - \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/searchindex.js mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/searchindex.js --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/searchindex.js 2016-11-29 15:44:06.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/searchindex.js 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Search.setIndex({envversion:50,filenames:["index","modules/card","modules/card_type","modules/card_type_converter","modules/component","modules/component_manager","modules/configuration","modules/controller","modules/criterion","modules/database","modules/fact","modules/fact_view","modules/file_format","modules/filter","modules/hook","modules/how_to_write_a_new_frontend","modules/log_uploader","modules/logger","modules/plugin","modules/render_chain","modules/renderer","modules/review_controller","modules/scheduler","modules/statistics_page","modules/stopwatch","modules/tag","modules/tag_tree"],objects:{"mnemosyne.libmnemosyne":{card:[1,0,0,"-"],card_type:[2,0,0,"-"],card_type_converter:[3,0,0,"-"],component:[4,0,0,"-"],component_manager:[5,0,0,"-"],configuration:[6,0,0,"-"],controller:[7,0,0,"-"],criterion:[8,0,0,"-"],database:[9,0,0,"-"],fact:[10,0,0,"-"],fact_view:[11,0,0,"-"],file_format:[12,0,0,"-"],filter:[13,0,0,"-"],hook:[14,0,0,"-"],log_uploader:[16,0,0,"-"],logger:[17,0,0,"-"],plugin:[18,0,0,"-"],render_chain:[19,0,0,"-"],renderer:[20,0,0,"-"],review_controller:[21,0,0,"-"],scheduler:[22,0,0,"-"],statistics_page:[23,0,0,"-"],stopwatch:[24,0,0,"-"],tag:[25,0,0,"-"],tag_tree:[26,0,0,"-"]},"mnemosyne.libmnemosyne.card":{Card:[1,1,1,""]},"mnemosyne.libmnemosyne.card.Card":{answer:[1,2,1,""],question:[1,2,1,""],reset_learning_data:[1,2,1,""],tag_string:[1,2,1,""]},"mnemosyne.libmnemosyne.card_type":{CardType:[2,1,1,""]},"mnemosyne.libmnemosyne.card_type.CardType":{component_type:[2,3,1,""],create_sister_cards:[2,2,1,""],edit_fact:[2,2,1,""],extra_data:[2,3,1,""],fact_data:[2,2,1,""],fact_key_format_proxies:[2,2,1,""],fact_key_names:[2,2,1,""],fact_key_with_name:[2,2,1,""],fact_keys:[2,2,1,""],fact_keys_and_names:[2,3,1,""],fact_views:[2,3,1,""],id:[2,3,1,""],is_fact_data_valid:[2,2,1,""],keyboard_shortcuts:[2,3,1,""],name:[2,3,1,""],render_answer:[2,2,1,""],render_question:[2,2,1,""],required_fact_keys:[2,3,1,""],unique_fact_keys:[2,3,1,""]},"mnemosyne.libmnemosyne.card_type_converter":{CardTypeConverter:[3,1,1,""]},"mnemosyne.libmnemosyne.card_type_converter.CardTypeConverter":{component_type:[3,3,1,""],convert:[3,2,1,""]},"mnemosyne.libmnemosyne.component":{Component:[4,1,1,""]},"mnemosyne.libmnemosyne.component.Component":{IMMEDIATELY:[4,3,1,""],LATER:[4,3,1,""],activate:[4,2,1,""],card_type_with_id:[4,2,1,""],card_types:[4,2,1,""],component_type:[4,3,1,""],config:[4,2,1,""],controller:[4,2,1,""],database:[4,2,1,""],deactivate:[4,2,1,""],flush_sync_server:[4,2,1,""],instantiate:[4,3,1,""],log:[4,2,1,""],main_widget:[4,2,1,""],plugins:[4,2,1,""],render_chain:[4,2,1,""],review_controller:[4,2,1,""],review_widget:[4,2,1,""],scheduler:[4,2,1,""],start_review:[4,2,1,""],stopwatch:[4,2,1,""],translator:[4,2,1,""],used_for:[4,3,1,""]},"mnemosyne.libmnemosyne.component_manager":{ComponentManager:[5,1,1,""]},"mnemosyne.libmnemosyne.component_manager.ComponentManager":{add_component_to_plugin:[5,2,1,""],all:[5,2,1,""],current:[5,2,1,""],deactivate_all:[5,2,1,""],debug:[5,2,1,""],register:[5,2,1,""],unregister:[5,2,1,""]},"mnemosyne.libmnemosyne.configuration":{Configuration:[6,1,1,""]},"mnemosyne.libmnemosyne.configuration.Configuration":{activate:[6,2,1,""],card_type_property:[6,2,1,""],change_user_id:[6,2,1,""],clone_card_type_properties:[6,2,1,""],component_type:[6,3,1,""],delete_card_type_properties:[6,2,1,""],determine_dirs:[6,2,1,""],fill_dirs:[6,2,1,""],load:[6,2,1,""],load_user_config:[6,2,1,""],machine_id:[6,2,1,""],save:[6,2,1,""],set_card_type_property:[6,2,1,""],set_defaults:[6,2,1,""]},"mnemosyne.libmnemosyne.controller":{Controller:[7,1,1,""]},"mnemosyne.libmnemosyne.controller.Controller":{change_card_type:[7,2,1,""],clone_card_type:[7,2,1,""],component_type:[7,3,1,""],create_new_cards:[7,2,1,""],delete_card_type:[7,2,1,""],delete_current_card:[7,2,1,""],delete_facts_and_their_cards:[7,2,1,""],delete_plugin:[7,2,1,""],edit_card_and_sisters:[7,2,1,""],heartbeat:[7,2,1,""],install_plugin:[7,2,1,""],save_file:[7,2,1,""],show_add_cards_dialog:[7,2,1,""],show_browse_cards_dialog:[7,2,1,""],show_configuration_dialog:[7,2,1,""],show_edit_card_dialog:[7,2,1,""],show_export_file_dialog:[7,2,1,""],show_getting_started_dialog:[7,2,1,""],show_import_file_dialog:[7,2,1,""],show_insert_img_dialog:[7,2,1,""],show_insert_sound_dialog:[7,2,1,""],show_insert_video_dialog:[7,2,1,""],show_manage_card_types_dialog:[7,2,1,""],show_manage_plugins_dialog:[7,2,1,""],show_new_file_dialog:[7,2,1,""],show_open_file_dialog:[7,2,1,""],show_save_file_as_dialog:[7,2,1,""],show_statistics_dialog:[7,2,1,""],show_sync_dialog:[7,2,1,""],show_tip_dialog:[7,2,1,""],star_current_card:[7,2,1,""],sync:[7,2,1,""],update_title:[7,2,1,""]},"mnemosyne.libmnemosyne.criterion":{Criterion:[8,1,1,""],CriterionApplier:[8,1,1,""]},"mnemosyne.libmnemosyne.criterion.Criterion":{active_card_type_added:[8,2,1,""],active_tag_added:[8,2,1,""],apply_to_card:[8,2,1,""],card_type_deleted:[8,2,1,""],component_type:[8,3,1,""],criterion_type:[8,3,1,""],data_to_string:[8,2,1,""],data_to_sync_string:[8,2,1,""],deactivated_card_type_added:[8,2,1,""],deactivated_tag_added:[8,2,1,""],instantiate:[8,3,1,""],is_empty:[8,2,1,""],is_tag_active:[8,2,1,""],set_data_from_string:[8,2,1,""],set_data_from_sync_string:[8,2,1,""],tag_deleted:[8,2,1,""]},"mnemosyne.libmnemosyne.criterion.CriterionApplier":{apply_to_database:[8,2,1,""],component_type:[8,3,1,""]},"mnemosyne.libmnemosyne.database":{Database:[9,1,1,""]},"mnemosyne.libmnemosyne.database.Database":{"new":[9,2,1,""],abandon:[9,2,1,""],add_card:[9,2,1,""],add_card_type:[9,2,1,""],add_criterion:[9,2,1,""],add_fact:[9,2,1,""],add_fact_view:[9,2,1,""],add_tag:[9,2,1,""],add_tag_to_cards_with_internal_ids:[9,2,1,""],backup:[9,2,1,""],card:[9,2,1,""],card_type:[9,2,1,""],card_types_in_use:[9,2,1,""],cards:[9,2,1,""],cards_due_for_ret_rep:[9,2,1,""],cards_from_fact:[9,2,1,""],cards_learn_ahead:[9,2,1,""],cards_new_memorising:[9,2,1,""],cards_to_relearn:[9,2,1,""],cards_unseen:[9,2,1,""],cards_with_scheduler_data:[9,2,1,""],change_user_id:[9,2,1,""],component_type:[9,3,1,""],criteria:[9,2,1,""],criterion:[9,2,1,""],current_criterion:[9,2,1,""],data_dir:[9,2,1,""],deactivate:[9,2,1,""],default_criterion_name:[9,3,1,""],default_name:[9,3,1,""],delete_card:[9,2,1,""],delete_card_type:[9,2,1,""],delete_criterion:[9,2,1,""],delete_fact:[9,2,1,""],delete_fact_view:[9,2,1,""],delete_tag:[9,2,1,""],delete_tag_if_unused:[9,2,1,""],display_name:[9,2,1,""],duplicates_for_fact:[9,2,1,""],fact:[9,2,1,""],fact_view:[9,2,1,""],get_or_create_tag_with_name:[9,2,1,""],get_or_create_tags_with_names:[9,2,1,""],has_card_type_with_id:[9,2,1,""],has_card_with_id:[9,2,1,""],has_clone:[9,2,1,""],has_criterion_with_id:[9,2,1,""],has_fact_view_with_id:[9,2,1,""],has_fact_with_id:[9,2,1,""],has_tag_with_id:[9,2,1,""],is_empty:[9,2,1,""],is_in_use:[9,2,1,""],is_loaded:[9,2,1,""],is_user_card_type:[9,2,1,""],load:[9,2,1,""],name:[9,2,1,""],path:[9,2,1,""],release_connection:[9,2,1,""],remove_tag_from_cards_with_internal_ids:[9,2,1,""],restore:[9,2,1,""],save:[9,2,1,""],scheduler_data_count:[9,2,1,""],set_current_criterion:[9,2,1,""],set_scheduler_data:[9,2,1,""],sorted_card_types:[9,2,1,""],suffix:[9,3,1,""],tag:[9,2,1,""],tags:[9,2,1,""],tags_from_cards_with_internal_ids:[9,2,1,""],unload:[9,2,1,""],update_card:[9,2,1,""],update_card_type:[9,2,1,""],update_criterion:[9,2,1,""],update_fact:[9,2,1,""],update_fact_view:[9,2,1,""],update_tag:[9,2,1,""],user_id:[9,2,1,""],version:[9,3,1,""]},"mnemosyne.libmnemosyne.fact":{Fact:[10,1,1,""]},"mnemosyne.libmnemosyne.fact_view":{FactView:[11,1,1,""]},"mnemosyne.libmnemosyne.file_format":{FileFormat:[12,1,1,""]},"mnemosyne.libmnemosyne.file_format.FileFormat":{component_type:[12,3,1,""],description:[12,3,1,""],do_import:[12,2,1,""],export_possible:[12,3,1,""],extension:[12,3,1,""],filename_filter:[12,3,1,""],import_possible:[12,3,1,""]},"mnemosyne.libmnemosyne.filter":{Filter:[13,1,1,""]},"mnemosyne.libmnemosyne.filter.Filter":{component_type:[13,3,1,""],run:[13,2,1,""]},"mnemosyne.libmnemosyne.hook":{Hook:[14,1,1,""]},"mnemosyne.libmnemosyne.hook.Hook":{component_type:[14,3,1,""],run:[14,2,1,""]},"mnemosyne.libmnemosyne.log_uploader":{LogUploader:[16,1,1,""]},"mnemosyne.libmnemosyne.log_uploader.LogUploader":{run:[16,2,1,""],upload:[16,2,1,""]},"mnemosyne.libmnemosyne.logger":{Logger:[17,1,1,""]},"mnemosyne.libmnemosyne.logger.Logger":{activate:[17,2,1,""],added_card:[17,2,1,""],added_card_type:[17,2,1,""],added_criterion:[17,2,1,""],added_fact:[17,2,1,""],added_fact_view:[17,2,1,""],added_media_file:[17,2,1,""],added_tag:[17,2,1,""],archive_old_log:[17,2,1,""],component_type:[17,3,1,""],deactivate:[17,2,1,""],deleted_card:[17,2,1,""],deleted_card_type:[17,2,1,""],deleted_criterion:[17,2,1,""],deleted_fact:[17,2,1,""],deleted_fact_view:[17,2,1,""],deleted_media_file:[17,2,1,""],deleted_tag:[17,2,1,""],dump_to_science_log:[17,2,1,""],edited_card:[17,2,1,""],edited_card_type:[17,2,1,""],edited_criterion:[17,2,1,""],edited_fact:[17,2,1,""],edited_fact_view:[17,2,1,""],edited_media_file:[17,2,1,""],edited_setting:[17,2,1,""],edited_tag:[17,2,1,""],get_timestamp:[17,2,1,""],loaded_database:[17,2,1,""],log_index_of_last_upload:[17,2,1,""],repetition:[17,2,1,""],saved_database:[17,2,1,""],set_timestamp:[17,2,1,""],start_logging:[17,2,1,""],started_program:[17,2,1,""],started_scheduler:[17,2,1,""],stopped_program:[17,2,1,""],timestamp:[17,3,1,""]},"mnemosyne.libmnemosyne.plugin":{Plugin:[18,1,1,""]},"mnemosyne.libmnemosyne.plugin.Plugin":{activate:[18,2,1,""],component_type:[18,3,1,""],components:[18,3,1,""],deactivate:[18,2,1,""],description:[18,3,1,""],name:[18,3,1,""]},"mnemosyne.libmnemosyne.render_chain":{RenderChain:[19,1,1,""]},"mnemosyne.libmnemosyne.render_chain.RenderChain":{component_type:[19,3,1,""],filter:[19,2,1,""],filters:[19,3,1,""],id:[19,3,1,""],register_filter:[19,2,1,""],register_filter_at_back:[19,2,1,""],register_filter_at_front:[19,2,1,""],register_renderer:[19,2,1,""],render_answer:[19,2,1,""],render_question:[19,2,1,""],renderer_for_card_type:[19,2,1,""],renderers:[19,3,1,""],unregister_filter:[19,2,1,""],unregister_renderer:[19,2,1,""]},"mnemosyne.libmnemosyne.renderer":{Renderer:[20,1,1,""]},"mnemosyne.libmnemosyne.renderer.Renderer":{component_type:[20,3,1,""],render:[20,2,1,""],update:[20,2,1,""],used_for:[20,3,1,""]},"mnemosyne.libmnemosyne.review_controller":{ReviewController:[21,1,1,""]},"mnemosyne.libmnemosyne.review_controller.ReviewController":{component_type:[21,3,1,""],counters:[21,2,1,""],grade_answer:[21,2,1,""],is_answer_showing:[21,2,1,""],is_question_showing:[21,2,1,""],reload_counters:[21,2,1,""],reset:[21,2,1,""],reset_but_try_to_keep_current_card:[21,2,1,""],set_render_chain:[21,2,1,""],set_state:[21,2,1,""],show_answer:[21,2,1,""],show_new_question:[21,2,1,""],state:[21,2,1,""],update_dialog:[21,2,1,""],update_status_bar_counters:[21,2,1,""]},"mnemosyne.libmnemosyne.scheduler":{Scheduler:[22,1,1,""]},"mnemosyne.libmnemosyne.scheduler.Scheduler":{active_count:[22,2,1,""],avoid_sister_cards:[22,2,1,""],card_count_scheduled_n_days_from_now:[22,2,1,""],component_type:[22,3,1,""],grade_answer:[22,2,1,""],is_in_queue:[22,2,1,""],is_prefetch_allowed:[22,2,1,""],last_rep_to_interval_string:[22,2,1,""],name:[22,3,1,""],next_card:[22,2,1,""],next_rep_to_interval_string:[22,2,1,""],non_memorised_count:[22,2,1,""],rebuild_queue:[22,2,1,""],remove_from_queue_if_present:[22,2,1,""],reset:[22,2,1,""],scheduled_count:[22,2,1,""],set_initial_grade:[22,2,1,""]},"mnemosyne.libmnemosyne.statistics_page":{HtmlStatisticsPage:[23,1,1,""],PlotStatisticsPage:[23,1,1,""],StatisticsPage:[23,1,1,""]},"mnemosyne.libmnemosyne.statistics_page.StatisticsPage":{component_type:[23,3,1,""],instantiate:[23,3,1,""],name:[23,3,1,""],prepare_statistics:[23,2,1,""],show_variants_in_combobox:[23,3,1,""],variants:[23,3,1,""]},"mnemosyne.libmnemosyne.stopwatch":{Stopwatch:[24,1,1,""]},"mnemosyne.libmnemosyne.stopwatch.Stopwatch":{component_type:[24,3,1,""],pause:[24,2,1,""],start:[24,2,1,""],stop:[24,2,1,""],time:[24,2,1,""],unpause:[24,2,1,""]},"mnemosyne.libmnemosyne.tag":{Tag:[25,1,1,""]},"mnemosyne.libmnemosyne.tag_tree":{TagTree:[26,1,1,""]},"mnemosyne.libmnemosyne.tag_tree.TagTree":{delete_subtree:[26,2,1,""],rename_node:[26,2,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","attribute","Python attribute"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:attribute"},terms:{"abstract":[0,4,15],"case":[4,5,15,22],"class":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26],"default":[1,2,4,5,6,9,15,17,19],"export":[0,19],"final":15,"function":[2,3,5,7,8,9,13,14,15,20],"import":[1,2,17,19,22],"int":1,"new":[3,7,9,10],"return":[2,3,9,21],"static":2,"true":[7,13,15,22,23],"try":[15,21],__all__:26,__default__:9,__init__:[4,15],__untagged__:25,_card_id:9,_id:[1,8,10,25],_timestamp:17,aaron:16,abandon:9,abl:[3,17],about:4,abov:15,absolut:[0,13],access:[4,15],accomod:1,account:2,achiev:[13,15],acq_rep:1,acquisit:1,across:[1,8],actionaddcard:15,activ:[0,1,4,5,6,8,15,17,18,21],activat:[18,21],active_card_type_ad:8,active_count:[17,21,22],active_tag_ad:8,activitycriterion:0,actual:[0,4,7,8,9,15],actual_interv:17,add:[0,15,17,19],add_card:[9,15],add_card_typ:9,add_cards_dialog:15,add_cards_dlg:15,add_component_to_plugin:5,add_criterion:9,add_fact:9,add_fact_view:9,add_tag:9,add_tag_to_cards_with_internal_id:9,addcardsdialog:15,addcardsdlg:15,added_card:17,added_card_typ:17,added_criterion:17,added_fact:17,added_fact_view:17,added_media_fil:17,added_tag:17,addit:1,adventur:15,after:[6,8,19,21],after_backup:14,after_load:14,after_repetititon:14,against:15,ago:22,all:[0,2,4,5,6,7,8,9,15,20,21,22,25],allow:[1,2,6,7,11,18,22,25],almost:15,alphabet:9,alreadi:[4,6,15,19],also:[0,1,2,4,7,9,15,18,21,22,26],alwai:[0,4],ani:[4,5,8,14],anonym:6,answer:[0,1,2,11,15,19,20,21,24],anyth:4,apart:[2,4,9,26],appear:9,append:15,appli:[0,6,8,15,25],applic:15,apply_to_card:8,apply_to_databas:8,approri:23,archive:17,archive_old_log:17,argument:[13,14,20],ask:21,assembl:[0,19,20],associ:[0,23],asymmetri:22,avail:[8,15,22],avoid_sister_card:22,back:[8,10,19],backend:8,backup:[4,9,14],backup_before_sync:15,bare:[9,15],base:[1,4,16,20],basic:[0,9,10],bauer:16,becaus:[2,4,6,8,11,22],becom:[4,18,22],been:[4,22],befor:[0,4,13,15,19,22],before_repetititon:14,before_unload:14,behaviour:[15,21],behind:3,belong:[1,2],below:10,best:[10,15,21],better:15,between:[4,10,15,17],both:22,bridg:15,browser:[0,1,15,19,23],build:15,built:9,bulk:8,bz2:17,cach:[4,20],calcul:23,call:[0,2,4,6,7,8,10,12,14,15,18,21,22],callback:8,can:[0,1,2,4,5,7,8,9,10,11,15,17,18,19,20,22,23,25],cannot:2,capabl:15,card:[],card_count_for_nod:26,card_count_scheduled_n_days_from_now:22,card_typ:[1,2,4,6,7,8,9,15,17,19,20],card_type_convert:[3,4],card_type_delet:8,card_type_id:11,card_type_properti:6,card_type_widget:4,card_type_with_id:4,card_types_in_us:9,cards_due_for_ret_rep:9,cards_from_fact:9,cards_learn_ahead:9,cards_new_memoris:9,cards_to_relearn:9,cards_unseen:9,cards_with_scheduler_data:9,cardtyp:[],cardtypeconvert:[],certain:[0,1,2,4,5,6,7,8,15,18,20,22],cgi:16,chain:[1,19],chang:[0,2,4,11,22],change_card_typ:7,change_user_id:[6,9],charact:10,charg:[15,23],check:[2,22],check_for_dupl:7,check_for_updated_media_fil:15,child_id:2,choos:1,client:[4,6,15],clone_card_typ:7,clone_card_type_properti:6,clone_nam:7,close:4,cloze:[1,2,14],code:[0,4,7,8,13,15,16,21],collect:[0,7],colour:6,combo:1,comp_typ:5,complet:[15,18],complex:[1,4],compoment:15,compon:[],component_class:5,component_manag:[2,3,4,5,6,7,8,9,12,13,14,15,16,17,18,19,20,21,22,23,24,26],component_typ:[2,3,4,6,7,8,9,12,13,14,17,18,19,20,21,22,23,24],componentmanag:[],config:[4,6,15],config_dir:6,configur:[],configuration_default:14,connect:[9,15],consid:[15,17],consist:[0,6,15],construct:15,constructor:4,contain:[0,1,2,7,8,10,13,15,19,20,22,23,26],context:[4,18],control:[2,3,4],convent:[11,26],convers:[10,22],convert:[0,3,8,13,22],copi:17,correspond:[2,3,7,14,15,20,23],could:[1,2,4,8,10,21,22,25],counter:21,cours:15,creat:[1,2,3,4,5,8,15,22],create_new_card:[7,15],create_sister_card:2,creation:[1,8],creation_tim:1,criteria:[8,9,25],criterion:4,criterion_appli:[4,8],criterion_typ:8,criterionappli:[0,8],css:20,cumberson:18,current:[1,5,8,17,21],current_criterion:9,custom:[1,23],dai:22,dangl:4,data:[0,1,2,3,6,8,9,10,14,15,19,23],data_dir:[6,9],data_str:8,data_to_str:8,data_to_sync_str:8,databas:[1,2,3,4,8],datastructur:26,datatyp:1,date:1,deactiv:[4,9,17,18],deactivate_al:5,deactivated_card_type_ad:8,deactivated_tag_ad:8,deal:15,debug:5,decor:11,def:15,default_criterion_nam:9,default_nam:9,defeat:15,defin:[9,21],delet:[1,2,3,8,22],delete_card:9,delete_card_typ:[7,9],delete_card_type_properti:6,delete_criterion:9,delete_current_card:7,delete_fact:9,delete_fact_view:9,delete_facts_and_their_card:7,delete_plugin:7,delete_subtre:26,delete_tag:9,delete_tag_if_unus:9,delete_unused_media_fil:14,deleted_card:[3,17],deleted_card_typ:17,deleted_criterion:17,deleted_fact:17,deleted_fact_view:17,deleted_media_fil:17,deleted_tag:17,denot:26,depend:[1,8,9,15],deriv:[0,2,4,9,10,15],descend:20,describ:[9,15],descript:[12,18],design:15,desktop:15,destroi:8,detail:[0,19],determin:[0,1,3,9,17,20],determine_dir:6,developp:15,devic:[4,15,21],dialog:[4,7,15],dictionari:[1,2,3,10,11,20,26],differ:[0,1,2,5,6,8,10,11,13,18,20,22,25],difficult:8,directori:9,disabl:8,disk:15,displai:[0,15,19,22,23],display_nam:9,display_name_for_nod:26,distinguish:11,divis:15,do_import:12,doc:7,doe:[5,8,15,19],don:[8,11,15,17,22],done:[2,4,15],dry_run:22,dump_to_science_log:17,duplicates_for_fact:9,dure:[1,4,6,8,10,11,15,17,22],dynam:[1,2],dynamically_create_media_fil:14,each:[0,4,8,20,23,26],easier:0,easili:7,edit:[2,3,15],edit_card_and_sist:7,edit_fact:2,edited_card:[1,3,17],edited_card_typ:17,edited_criterion:17,edited_fact:17,edited_fact_view:17,edited_media_fil:17,edited_set:17,edited_tag:17,effect:18,effici:[1,4,5,10,25],either:[0,15,19,23],els:15,embed:15,enabl:5,encount:22,enough:[15,17],entir:[15,26],entri:17,error:15,especi:21,etc:0,even:6,event:1,everi:6,everyth:[7,15],exampl:[0,15],excecut:15,exception:5,exchang:6,exec_:15,execut:13,exist:[6,22],expand:[0,19],experi:21,explicitli:1,export_poss:12,extens:[9,12],extern:[1,10,25],extra:[0,1,13,14,20],extra_data:[1,2],extra_tag_nam:12,facilit:10,fact:[1,2,3,7,9],fact_data:[2,7,15,20],fact_kei:[2,6,13,20],fact_key_format_proxi:2,fact_key_nam:2,fact_key_with_nam:2,fact_keys_and_nam:2,fact_view:[1,2,9,11,17],fact_view_id:11,factor:22,factview:[],fall:22,fals:[9,12,15,19,22],fast:[1,25],faster:8,feel:15,fetch:8,field:[0,10,26],file:[0,1,4,6,7,10,15,16,17,19,25],file_format:12,fileformat:[],filenam:[12,16,17],filename_filt:12,filetyp:7,fill:6,fill_dir:6,filter:[4,7],filter_class:19,find:15,fire:15,first:[0,1,5,6,9,12,19,22,24],flag:1,flexibl:[0,1],flush:4,flush_sync_serv:4,fly:17,folder:17,follow:[14,15,26],font:6,foreign:[0,2,10],forgotten:1,form:[0,2,11,19],format:[2,4,17,20],french:2,from:[0,2,4,8,9,10,11,15,17,19,21,22,26],front:[10,15,19],frontend:7,full:[9,25],fulton:16,gener:[0,1,2,15,22,23],generic_card_type_widget:4,get:[0,1,8,10,14,15,19,22],get_curr:15,get_or_create_tag_with_nam:9,get_or_create_tags_with_nam:9,get_timestamp:17,give:[2,15,18,22],given:[2,20,22,25],good:11,grade:[1,2,7,9,15,21,22],grade_answ:[14,21,22],graphic:[15,23],group:[2,15,18],guarante:26,gui:[0,5,7,15,22,23],hand:2,handl:[0,3,18],happen:[2,4,17],has_card_type_with_id:9,has_card_with_id:9,has_clon:9,has_criterion_with_id:9,has_fact_view_with_id:9,has_fact_with_id:9,has_tag_with_id:9,have:[1,2,4,6,7,15,17,22,23],heartbeat:7,heavi:15,help:15,here:[2,4,7,8,9,15,18,22],hidden:2,hierarch:26,hierarchi:[2,25],higher:1,hint:23,histori:[15,17],hold:4,hook:4,how:[2,7],howev:15,html:[20,23],htmlstatisticspag:23,icon:15,idea:5,ident:6,identifi:[1,10,25],immediately:4,implement:[7,9,12,15,18,21,22,25],import_poss:12,improv:15,in_front:[13,19],includ:[1,8,15,25],inclus:21,indeped:15,independ:[0,7,15],index:[0,26],ineffectu:22,info:[6,17],inform:[0,1,10,20,22,23],inherit:[2,11,15],initi:22,initial:2,initialis:4,input:4,insid:[5,15],inside:15,install_plugin:7,instanc:[4,5,8,14,18,19],instanti:[4,8,15,18,21,23,26],instantiat:4,instead:[8,15,19,26],integ:1,integr:0,interact:22,interested_in_old_rep:15,interfac:[9,15,21],interfer:11,intern:[1,10,22,25,26],introduc:6,invalid:[21,22],is_answer_show:21,is_empti:[8,9],is_fact_data_valid:2,is_id_intern:9,is_in_queu:22,is_in_us:9,is_load:9,is_prefetch_allow:22,is_question_show:21,is_tag_act:8,is_user_card_typ:9,jeff:16,jim:16,just:[2,11,15],kanji:2,keep:[21,24],kei:[2,3,6,10,11,17,20],keyboard_shortcut:2,know:15,kwd:[2,3,4,7,8,9,12,13,14,20,22],labour:15,laps:1,larg:17,larger:15,last:[5,6],last_rep:[1,22],last_rep_to_interval_str:22,later:[4,5],latex:0,layer:0,lazili:[4,5],learn:1,learn_ahead:22,left:22,let:15,level:[0,1,2,15,25,26],librari:22,life:8,lift:15,like:[0,2,5,6,10,15,19,21,22],limit:[9,15],line:15,link:0,list:[0,2,4,9,13,18,19],live:5,load:[6,9,14],load_user_config:6,loaded_databas:17,log:[1,4,5,6,9,10,15,17,22,25],log_index_of_last_upload:17,log_upload:16,logger:[],logic:[0,7],logupload:[],look:[15,26],lot:[4,15],m_1:10,machin:17,machine_id:[6,17],mai:9,main:[2,3,4,5,15,24,26],main_widget:[4,15],mainwidget:15,mainwindow:15,make:[0,1,3,4,8,10,12,13,15,22],manag:[4,5,23],mani:[0,4,5,13,19,21],mask:15,mean:[4,5,10,19],meant:26,measur:24,mechan:0,media:[4,15],mention:0,menu:15,messag:[5,22],method:[4,14,15,18,23],might:[6,15],minimum:15,minut:1,mixin:18,mnemogogo:22,mnemosyn:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26],mobil:[4,15,21],modif:1,modifi:15,modul:0,month:23,more:[0,1,2,4,15],most:4,move:15,msg:5,much:[8,10],multipl:18,name:[2,9,10,11,17,18,19,22,23,25],need:[0,1,2,4,5,6,7,8,11,13,15,17,18,19,21,22,23,26],never:[8,15],new_card:3,new_card_typ:[3,6,7],new_fact_data:[2,7],new_fact_kei:3,new_grad:22,new_nam:26,new_quest:15,new_tag_nam:7,new_typ:3,new_user_id:6,next:[15,22,23],next_card:22,next_rep:[1,22],next_rep_to_interval_str:22,node:26,non:8,non_memorised_count:[17,21,22],none:[1,2,4,5,6,7,8,9,10,12,15,17,20,22,25],normal:[0,2],note:[2,3,7,11,15,21],now:[9,15,22],number:[0,1,2,23],object:[1,8,10,15,25],obsolet:4,obvious:5,obviousli:17,offer:1,old_card_typ:[3,6,7],old_fact_kei:3,old_typ:3,onc:[5,15],onli:[1,5,15,17,20,21,26],only:4,oper:[0,2,7,13,15,19],oppos:[1,5,11],optimis:15,option:15,order:[0,2,3,6,9,13,15,18,19],organis:26,other:[0,2,4,5,7,15,19,20],otherwis:4,our:[16,17],out:[0,7,8,22],outsid:[15,22],overrid:[2,4,15,17],overridden:2,overwritten:4,own:[4,15,17],p_1:10,page:[0,20,23],painless:15,paramet:15,parent:[9,15,23],parent_id:2,pars:22,part:8,partial:26,particip:0,particular:23,pass:[0,4,20],password:7,past:17,path:[0,9,13,19],paus:[15,24],peopl:8,perceiv:15,perform:[0,7,19],period:7,phase:1,pick:23,pickl:8,piec:23,pleas:15,plot:23,plotstatisticspag:23,plugin:[1,4,7],plugin_class_nam:5,point:[0,14],port:7,posix:1,possibl:[1,2,10,15,21],postprocess_q_a_cloz:14,ppygui_ui:15,prefer:5,pregener:15,prepare_statist:23,preprocess_cloz:14,present:2,prevent:8,previou:[15,22],process:[0,1,7,8,15,22],program:[0,4,8,14,18,21],pronunci:[0,2,10],properti:6,property_nam:6,property_valu:6,provid:[4,15],pull:21,pure:20,purpos:11,pyqt:15,pyqt_ui:15,python:[1,8,15],qobject:15,queri:1,question:[0,1,2,11,15,19,20,21,24],queue:[15,21,22],rather:[3,15,26],raw:[0,19],read:[2,8,11],realli:[13,15],reason:[1,4,5,10,15,25],rebuild_queu:22,rebuilt:[20,22],recip:0,recognit:0,recommend:15,recreat:9,redraw_now:15,refer:4,regist:[4,5,8,14,15,18,19,23],register_filt:[13,19],register_filter_at_back:19,register_filter_at_front:19,register_render:19,regular:15,rel:[0,13,19],relat:[0,3,7],relationship:4,releas:9,release_connect:9,relev:22,reli:4,reload:21,reload_count:[15,21],remove_from_queue_if_pres:22,remove_tag_from_cards_with_internal_id:9,rename_nod:26,render:[1,4,19],render_answ:[2,19],render_arg:[1,2,13,19,20],render_chain:[1,2,4,13,19,21],render_quest:[2,19],renderchain:13,renderer_class:19,renderer_for_card_typ:19,repaint:15,repetit:[0,1,17,22],repetition_onli:9,repres:[13,20,23],represent:[0,19],request:23,requir:2,required_fact_kei:2,reset:[1,21,22],reset_but_try_to_keep_current_card:21,reset_learning_data:1,resolut:1,resourc:15,respect:1,respons:15,rest:[0,8,13,22],restor:[4,9],result:2,ret_rep:1,retent:1,reus:[4,10],review:[0,1,4,7,8,15,21,22],review_control:[4,15,21],review_widget:[4,15],reviewcontrol:[],reviewwidget:[15,21],revis:15,right:[0,19],rise:18,risk:22,run:[4,7,13,14,15,16,18,19,21,26],same:[0,2,5,7,9,22],save:[1,2,6,7,9,15],save_after_n_rep:15,save_fil:7,saved_databas:17,schedul:[1,4],scheduled_count:[17,21,22],scheduled_interv:17,scheduler_data:[1,9],scheduler_data_count:9,scheduler_nam:17,scienc:15,script:[15,16],search:0,second:1,see:[2,7,8,9,15],seen:[1,22],select:8,self:[2,15,17,23,26],send:8,sens:15,sent:[0,1,19],separ:[2,7,9,18,25,26],sequenc:[11,20],server:[4,6,7],serversid:16,session:4,set:[0,1,2,3,6,7,8,10,13,15,20,22,23],set_card_type_properti:6,set_current_criterion:9,set_data_from_str:8,set_data_from_sync_str:8,set_default:[6,14],set_initial_grad:22,set_render_chain:21,set_scheduler_data:9,set_stat:21,set_timestamp:17,sever:[0,10,23],sheet:20,should:[1,2,3,4,7,8,10,11,15,17,19,20,21],show:[7,15],show_add_cards_dialog:[7,15],show_answ:21,show_browse_cards_dialog:7,show_configuration_dialog:7,show_edit_card_dialog:7,show_export_file_dialog:7,show_getting_started_dialog:7,show_import_file_dialog:7,show_insert_img_dialog:7,show_insert_sound_dialog:7,show_insert_video_dialog:7,show_manage_card_types_dialog:7,show_manage_plugins_dialog:7,show_new_file_dialog:7,show_new_quest:21,show_open_file_dialog:7,show_save_file_as_dialog:7,show_statistics_dialog:7,show_sync_dialog:7,show_tip_dialog:7,show_variants_in_combobox:23,show_xxx_dialog:7,shown:[0,24],shutdown:4,side:[0,18],signal:[15,20],similar:15,similarli:15,simplest:15,simpli:15,sinc:[0,1,2,6],singl:16,sister:[2,3,22],situat:9,slow:[15,21],sm2_mnemosyn:14,socket:15,some:[15,20],sometim:2,sort:9,sort_kei:9,sorted_card_typ:9,space:[2,15],specialti:2,specif:[0,15,19,20],specifi:[2,15],split:7,sql:1,sqlite:15,sqlite_log:9,sqlite_no_pregenerated_data:15,sqlite_nopregenerateddata:15,sqlite_statist:9,sqlite_sync:[9,14],stage:5,standard:[0,1,10,15],star_current_card:7,start:[8,15,18,21,22,24],start_log:17,start_review:4,start_tim:24,started_program:17,started_schedul:17,startup:15,state:[1,5,21],statist:[0,9,15,23],statistics_pag:[4,23],statistics_widget:23,statisticspag:[],statu:8,still:[4,18,22],stop:[4,24],stopped_program:17,stopwatch:[4,15],storag:[0,2,3,8],store:[1,2,4,5,6,8,10,15,17,26],string:[8,11,13,19,22],studi:15,style:20,subsequ:4,subset:8,suffix:9,suitabl:[0,19],support:[1,7,15],sure:[1,4,12,13,15,22],swap:[0,7],sync:[1,4,6,7,8,9,10,11,15,17,25],sync_serv:4,syntax:10,tab:23,tag:[1,8,9,10],tag_delet:8,tag_nam:[7,15],tag_str:1,tag_tre:26,tags_from_cards_with_internal_id:9,tagtre:[],take:[4,5,24],taken:2,tell:15,tempt:2,text:[0,13,15,19,20],than:[2,5,8,15],thei:[1,2,4,6,10,13,18,22],them:[0,1,3,4,11,15,21,22],therebi:[2,15],therefor:[4,18,22],thi:[0,1,2,3,4,5,6,8,10,12,14,15,17,19,20,21,22,23,25,26],thinking_tim:17,those:[2,4,18],though:6,thread:9,three:[0,15],through:[0,1,15,19],time:[0,1,4,5,6,15,17,19,22,24,26],timestamp:[1,17],tip:15,todai:22,togeth:8,tomorrow:22,toolkit:[0,15],track:24,transit:3,translat:[0,2,4,11],treat:22,tree:26,trivial:[3,15],tupl:21,two:[0,3,7,15,26],type:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,19,20,22],typic:[0,4,5,20,21,23],udp:15,ui_compon:[4,15],under:4,unescap:10,uniqu:[11,26],unique_fact_kei:[2,9],unit:[0,10],unload:[9,14],unpaus:[15,24],unregist:5,unregister_filt:19,unregister_render:19,unseen:22,untag:25,updat:[8,15,20],update:20,update_card:9,update_card_typ:9,update_criterion:9,update_dialog:21,update_fact:9,update_fact_view:9,update_status_bar:15,update_status_bar_count:21,update_tag:9,update_titl:7,upload:[6,15,16],upload_science_log:15,used:[1,8],used_for:[3,4,5,8,14,20,23],user:[2,4,5,9,15,17,18,21,22,24],user_id:[6,9],userid_index:17,userid_machineid_index:17,usernam:7,using:19,vain:4,valu:[0,6,15],vari:2,variabl:[1,2,8],variant:23,variant_id:23,verbos:2,veri:[1,19],version:[6,9,15],version_str:17,view:[1,2,11,20],wai:[0,3,5,15,22],wait:4,want:[15,19],watch:24,watter:16,week:[22,23],well:[2,11],what:[11,15],when:[1,2,4,5,6,8,10,15,17,18,21,22,24,26],where:[0,2,15,23],wherea:[1,10,25],whether:[1,8,15,22],which:[0,1,2,3,4,5,7,8,10,13,15,18,19,20,21,22,23],widget:[4,5,15,21,23],window:[1,15],within:15,without:9,won:0,word:[0,2,10],work:[0,4,15],world:[1,10,25],would:8,write:[7,8],writer:[0,19],written:[0,15],xml:[1,10,25],yesterdai:22,yet:[4,15,22],you:[13,15,17],your:[13,15],yourself:15},titles:["Libmnemosyne overview","Card","CardType","CardTypeConverter","Component","ComponentManager","Configuration","Controller","Criterion","Database","Fact","FactView","FileFormat","Filter","Hook","How to write a new frontend","LogUploader","Logger","Plugin","RenderChain","Renderer","ReviewController","Scheduler","StatisticsPage","Stopwatch","Tag","TagTree"],titleterms:{"new":15,card:1,cardtyp:2,cardtypeconvert:3,compon:4,componentmanag:5,configur:6,content:0,control:7,criterion:8,databas:9,fact:10,factview:11,fileformat:12,filter:13,frontend:15,hook:14,how:15,indice:0,libmnemosyn:0,logger:17,logupload:16,overview:0,plugin:18,render:20,renderchain:19,reviewcontrol:21,schedul:22,statisticspag:23,stopwatch:24,tabl:0,tag:25,tagtre:26,write:15}}) \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/index.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/index.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/index.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/index.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ -.. libmnemosyne documentation master file, created by sphinx-quickstart on Sat Aug 9 10:59:10 2008. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Libmnemosyne overview -============================== - -Libmnemosyne consists of a number of components, which can be swapped in and -out. This is handled by the ComponentManager. Examples of components are the -scheduler, the storage layer, card types, plugins, ... - -The basic unit of information from which Cards are derived is called a Fact, -containing a set of fields and their associated values. E.g., for a three-sided -CardType, these fields are foreign word, pronunciation and translation. - -A FactView collects a number of the fields of a Fact into question and answers. -E.g., the three-sided CardType has a recognition FactView, where the question -contains the foreign word, and the answer contains the pronunciation and the -translation. - -As mentioned before, a Fact is linked to a CardType, and each CardType lists -a set of FactViews. - -The actual Cards are generated from the data in Fact using the recipe of a -certain FactView. A Card also contains all the repetition data needed for the -Scheduler to do its work. Since the question and answers are generated from -the Fact data each time a Card is shown, related Cards (i.e. Cards with -different FactViews of the same Fact) are always consistent. - -The actual displaying of the data in a Card is handled by a RenderChain, which -details the operations needed to get from the raw data in a Card to a -representation of its question and answer, in a form either suitable for -displaying in a browser, or exporting to a text file, ... . First the raw data -is sent through Filters, which perform operations which can be useful for many -card types, like expanding relative paths. Then this data is assembled in the -right order in a Renderer, which can be card type specific. - -At several points in the program, plugin writers can hook in their code using -the Hook mechanism. - -Before the data is passed to the Renderer, Filters can be applied to it. This -is an extra level of flexibility, and can be used to generate LaTeX, convert -relative paths to absolute paths, etc ... - -To determine which cards are active (i.e.) participate in the review process, -a mechanism of ActivityCriterion and CriterionApplier is used. - -In order to make it easier for other GUI frontends to be written, all the logic -typically needed for GUIs, but that is independent of the actual GUI toolkit -used, is abstracted in controllers. In order to get more flexibility, there -are two of them: one related to the review process (which is different for -different schedulers), and one related to the rest of the program (which -normally won't change). - -There is also mechanism for plugins to add new statistical data to the standard -statistics in an integrated way. - - -Contents -======== - -.. toctree:: - :maxdepth: 2 - - modules/component - modules/component_manager - modules/fact - modules/fact_view - modules/tag - modules/tag_tree - modules/card_type - modules/card - modules/card_type_converter - modules/render_chain - modules/filter - modules/renderer - modules/controller - modules/review_controller - modules/configuration - modules/database - modules/file_format - modules/hook - modules/log_uploader - modules/logger - modules/plugin - modules/scheduler - modules/stopwatch - modules/statistics_page - modules/criterion - - modules/how_to_write_a_new_frontend - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/card.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/card.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/card.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/card.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`Card` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.card - -.. autoclass:: Card - :members: - :undoc-members: - :inherited-members: diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/card_type_converter.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/card_type_converter.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/card_type_converter.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/card_type_converter.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`CardTypeConverter` -======================== - -.. automodule:: mnemosyne.libmnemosyne.card_type_converter - -.. autoclass:: CardTypeConverter - :members: - :undoc-members: - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/card_type.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/card_type.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/card_type.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/card_type.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`CardType` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.card_type - -.. autoclass:: CardType - :members: - :undoc-members: - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/component_manager.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/component_manager.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/component_manager.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/component_manager.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`ComponentManager` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.component_manager - -.. autoclass:: ComponentManager - :members: - :undoc-members: - :inherited-members: diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/component.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/component.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/component.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/component.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`Component` -====================== - -.. automodule:: mnemosyne.libmnemosyne.component - -.. autoclass:: Component - :members: - :undoc-members: - :inherited-members: diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/configuration.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/configuration.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/configuration.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/configuration.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`Configuration` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.configuration - -.. autoclass:: Configuration - :members: - :undoc-members: - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/controller.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/controller.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/controller.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/controller.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`Controller` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.controller - -.. autoclass:: Controller - :members: - :undoc-members: - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/criterion.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/criterion.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/criterion.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/criterion.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -:mod:`Criterion` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.criterion - -.. autoclass:: Criterion - :members: - :undoc-members: - -.. autoclass:: CriterionApplier - :members: - :undoc-members: - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/database.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/database.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/database.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/database.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`Database` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.database - -.. autoclass:: Database - :members: - :undoc-members: - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/fact.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/fact.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/fact.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/fact.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`Fact` -=========== - -.. automodule:: mnemosyne.libmnemosyne.fact - -.. autoclass:: Fact - :members: - :undoc-members: - :inherited-members: diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/fact_view.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/fact_view.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/fact_view.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/fact_view.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`FactView` -====================== - -.. automodule:: mnemosyne.libmnemosyne.fact_view - -.. autoclass:: FactView - :members: - :undoc-members: - :inherited-members: diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/file_format.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/file_format.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/file_format.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/file_format.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`FileFormat` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.file_format - -.. autoclass:: FileFormat - :members: - :undoc-members: - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/filter.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/filter.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/filter.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/filter.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`Filter` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.filter - -.. autoclass:: Filter - :members: - :undoc-members: - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/hook.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/hook.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/hook.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/hook.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`Hook` -============== - -.. automodule:: mnemosyne.libmnemosyne.hook - -.. autoclass:: Hook - :members: - :undoc-members: - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/how_to_write_a_new_frontend.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/how_to_write_a_new_frontend.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/how_to_write_a_new_frontend.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/how_to_write_a_new_frontend.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ -How to write a new frontend -=========================== - -libmnemosyne is designed in such a way that writing a new front is as painless as possible. All the code for running a GUI which is actually GUI toolkit independent is grouped in two controllers: the main ui controller and the review ui controller. In order to build a new frontend, you need to create a main widget which inherits from ``MainWidget`` and implements its interface, and similarly a review widget which inherits from ``ReviewWidget``. - -In order to get a feel for how this works, it's best by starting to study the code for the ppygui_ui Windows Mobile client, which is the simplest possible frontend, as it only supports reviewing cards. - -There are three files in that frontend: - -* a startup script, which specifies which components your frontend wants to activate in libmnemosyne, whether you are running on a device which is resource limited, ... . - -* a main widget, which corresponds to the application level widget in the GUI toolkit, and is in charge of showing error dialogs, displaying menus. - -* the review widget, where you need to implement a.o. the code to display text in the question window, ... . - - -To give a better feeling for how the division of labour between your own new GUI code and the GUI independent code in the controllers works, consider this example from the 'add cards' functionality in the PyQt frontend. - -When the user activates the menu option or icon to add cards, it will fire up a certain function, which in the PyQt frontend is called ``add_cards()``:: - - QObject.connect(self.actionAddCards, SIGNAL("activated()"), MainWindow.add_cards) - -The implementation of this function is rather trivial, it just calls the controller:: - - def add_cards(self): - self.controller().show_add_cards_dialog() - -The code above is code you need to implement for your new frontend, but as you can see, it's rather trivial. - -The controller's ``show_add_cards_dialog`` function looks like this:: - - def show_add_cards_dialog(self): - self.stopwatch().pause() - self.component_manager.get_current("add_cards_dialog")\ - (self.component_manager).activate() - review_controller = self.review_controller() - review_controller.reload_counters() - if review_controller.card is None: - review_controller.new_question() - else: - review_controller.update_status_bar() - self.stopwatch().unpause() - -This is where the heavy lifting is done, but it's completely UI independent, and there should be no need for you to modify that code. - -In order for the controller to know where it can find the actual add cards dialog, which for PyQt is called ``AddCardsDlg`` , you need to have that dialog derive from the abstract ``libmnemosyne.ui_components.dialogs.AddCardsDialog``, and provide an activate function, which for the PyQt toolkit is simply:: - - def activate(self): - self.exec_() - -Finally, you need to register the ``AddCardsDlg`` component. That is what the following line does inside the main startup script (which for PyQt is simply called ``mnemosyne``):: - - mnemosyne.components.append(("mnemosyne.pyqt_ui.add_cards_dlg", - "AddCardsDlg")) - -Inside the ``AddCardsDlg``, there is of course lots of UI specific code, but once the dialog has enough data to create the cards, it simply calls:: - - self.controller().create_new_cards(fact_data, card_type, grade, tag_names) - -So, the ``AddCardsDlg`` should almost entirely consist of GUI dependent code. All the GUI indepedent code to actually create the cards is contained within the controller's ``create_new_cards()`` method. - -If you feel like you need to override the review or the main controller provided by libmnemosyne, please let the developpers know. Either its design is not general enough, or you are trying to work against libmnemosyne rather than with it. - -Tips for creating a responsive client: - -* When instantiating a ``libmnemosyne.Mnemosyne`` object, there are two parameters you need to provide: ``upload_science_logs`` and ``interested_in_old_reps``. If you are writing a mobile client which syncs to a desktop version of mnemosyne, it is recommended that you don't deal with uploading the science logs yourself, but let the desktop client deal with that. As for ``interested_in_old_reps``, if your mobile client does not include graphical statistics using the revision history, it does not make sense to store this history on your device. -* The standard instantiation of a ``libmnemosyne.Mnemosyne`` object includes all components in libmnemosyne. If you are writing a mobile client with e.g. only review capabilities, it does not make sense to include all these components. See the example of the Windows Mobile ppygui_ui frontend for a client which only uses the bare minimum of components to improve startup time. -* If your mobile client does not include a card browser, you can save some disk space by not storing pregenerated questions or answers. To achieve this, make sure you do not include the regular ``SQLite`` component, but this one:: - - ("mnemosyne.libmnemosyne.databases.SQLite_no_pregenerated_data", - "SQLite_NoPregeneratedData") - -* libmnemosyne does some optimisation by trying to show the next question before the grading of the previous question is completed. This improves the perceived responsiveness of the client. However, some GUI toolkits (e.g. Qt) queue widget updates and only excecute them when there is no more processing going on, thereby defeating libmnemosyne's optimisation. For that reason, there is a function ``review_widget().redraw_now`` which is used to tell the GUI toolkit to do the repaint now. If your toolkit also has similar behaviour, implementing this function can really help to mask slow database access. -* If save operations are slow on your mobile device, you might want to consider setting a larger default value instead of ``save_after_n_reps = 1`` in ``config.py``. -* If media files will never be edited outside of Mnemosyne on your mobile device, you can save time during sync by setting ``check_for_updated_media_files = False`` in ``config.py``. -* If you are really adventurous, you can set ``backup_before_sync = True`` in ``config.py``. - - - -Notes: - -* If you need access to the main widget when you are constructing the review widget, e.g. to specify it's parent, you can access it using `self.main_widget()`` -* If you need access to some components of libmnemosyne to construct your widget (e.g. the configuration), these might not yet be available inside your ``__init__()`` method. In this case, you need to move that code to your widget's ``activate()`` method, at which time all the other compoments will already be active. -* Everything described here applies not only for Python frontends, but also for frontends not written in Python, which access libmnemosyne through an UDP socket or through the Python-embedded-in-C bridge. diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/logger.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/logger.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/logger.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/logger.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`Logger` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.logger - -.. autoclass:: Logger - :members: - :undoc-members: - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/log_uploader.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/log_uploader.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/log_uploader.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/log_uploader.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`LogUploader` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.log_uploader - -.. autoclass:: LogUploader - :members: - :undoc-members: - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/plugin.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/plugin.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/plugin.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/plugin.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`Plugin` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.plugin - -.. autoclass:: Plugin - :members: - :undoc-members: - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/render_chain.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/render_chain.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/render_chain.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/render_chain.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`RenderChain` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.render_chain - -.. autoclass:: RenderChain - :members: - :undoc-members: - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/renderer.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/renderer.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/renderer.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/renderer.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`Renderer` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.renderer - -.. autoclass:: Renderer - :members: - :undoc-members: - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/review_controller.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/review_controller.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/review_controller.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/review_controller.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`ReviewController` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.review_controller - -.. autoclass:: ReviewController - :members: - :undoc-members: - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/scheduler.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/scheduler.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/scheduler.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/scheduler.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`Scheduler` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.scheduler - -.. autoclass:: Scheduler - :members: - :undoc-members: - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/statistics_page.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/statistics_page.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/statistics_page.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/statistics_page.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -:mod:`StatisticsPage` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.statistics_page - -.. autoclass:: StatisticsPage - :members: - :undoc-members: - -.. autoclass:: PlotStatisticsPage - :members: - :undoc-members: - -.. autoclass:: HtmlStatisticsPage - :members: - :undoc-members: diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/stopwatch.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/stopwatch.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/stopwatch.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/stopwatch.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`Stopwatch` -=============================== - -.. automodule:: mnemosyne.libmnemosyne.stopwatch - -.. autoclass:: Stopwatch - :members: - :undoc-members: - diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/tag_tree.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/tag_tree.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/tag_tree.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/tag_tree.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -:mod:`TagTree` -============== - -.. automodule:: mnemosyne.libmnemosyne.tag_tree - -.. autoclass:: TagTree - :members: - :undoc-members: diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/tag.txt mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/tag.txt --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/tag.txt 2013-12-03 10:42:03.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_sources/modules/tag.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -:mod:`Tag` -========== - -.. automodule:: mnemosyne.libmnemosyne.tag - -.. autoclass:: Tag - :members: - :undoc-members: - :inherited-members: Binary files /tmp/tmpNoYn47/ajGK50spUe/mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/ajax-loader.gif and /tmp/tmpNoYn47/vW_aZbQ35_/mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/ajax-loader.gif differ diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/alabaster.css mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/alabaster.css --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/alabaster.css 2016-11-29 15:44:06.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/alabaster.css 1970-01-01 00:00:00.000000000 +0000 @@ -1,693 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif; - font-size: 17px; - background-color: #fff; - color: #000; - margin: 0; - padding: 0; -} - - -div.document { - width: 940px; - margin: 30px auto 0 auto; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 220px; -} - -div.sphinxsidebar { - width: 220px; - font-size: 14px; - line-height: 1.5; -} - -hr { - border: 1px solid #B1B4B6; -} - -div.body { - background-color: #fff; - color: #3E4349; - padding: 0 30px 0 30px; -} - -div.body > .section { - text-align: left; -} - -div.footer { - width: 940px; - margin: 20px auto 30px auto; - font-size: 14px; - color: #888; - text-align: right; -} - -div.footer a { - color: #888; -} - -p.caption { - font-family: inherit; - font-size: inherit; -} - - -div.relations { - display: none; -} - - -div.sphinxsidebar a { - color: #444; - text-decoration: none; - border-bottom: 1px dotted #999; -} - -div.sphinxsidebar a:hover { - border-bottom: 1px solid #999; -} - -div.sphinxsidebarwrapper { - padding: 18px 10px; -} - -div.sphinxsidebarwrapper p.logo { - padding: 0; - margin: -10px 0 0 0px; - text-align: center; -} - -div.sphinxsidebarwrapper h1.logo { - margin-top: -10px; - text-align: center; - margin-bottom: 5px; - text-align: left; -} - -div.sphinxsidebarwrapper h1.logo-name { - margin-top: 0px; -} - -div.sphinxsidebarwrapper p.blurb { - margin-top: 0; - font-style: normal; -} - -div.sphinxsidebar h3, -div.sphinxsidebar h4 { - font-family: 'Garamond', 'Georgia', serif; - color: #444; - font-size: 24px; - font-weight: normal; - margin: 0 0 5px 0; - padding: 0; -} - -div.sphinxsidebar h4 { - font-size: 20px; -} - -div.sphinxsidebar h3 a { - color: #444; -} - -div.sphinxsidebar p.logo a, -div.sphinxsidebar h3 a, -div.sphinxsidebar p.logo a:hover, -div.sphinxsidebar h3 a:hover { - border: none; -} - -div.sphinxsidebar p { - color: #555; - margin: 10px 0; -} - -div.sphinxsidebar ul { - margin: 10px 0; - padding: 0; - color: #000; -} - -div.sphinxsidebar ul li.toctree-l1 > a { - font-size: 120%; -} - -div.sphinxsidebar ul li.toctree-l2 > a { - font-size: 110%; -} - -div.sphinxsidebar input { - border: 1px solid #CCC; - font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif; - font-size: 1em; -} - -div.sphinxsidebar hr { - border: none; - height: 1px; - color: #AAA; - background: #AAA; - - text-align: left; - margin-left: 0; - width: 50%; -} - -/* -- body styles ----------------------------------------------------------- */ - -a { - color: #004B6B; - text-decoration: underline; -} - -a:hover { - color: #6D4100; - text-decoration: underline; -} - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - margin: 30px 0px 10px 0px; - padding: 0; -} - -div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } -div.body h2 { font-size: 180%; } -div.body h3 { font-size: 150%; } -div.body h4 { font-size: 130%; } -div.body h5 { font-size: 100%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: #DDD; - padding: 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - color: #444; - background: #EAEAEA; -} - -div.body p, div.body dd, div.body li { - line-height: 1.4em; -} - -div.admonition { - margin: 20px 0px; - padding: 10px 30px; - background-color: #EEE; - border: 1px solid #CCC; -} - -div.admonition tt.xref, div.admonition code.xref, div.admonition a tt { - background-color: ; - border-bottom: 1px solid #fafafa; -} - -dd div.admonition { - margin-left: -60px; - padding-left: 60px; -} - -div.admonition p.admonition-title { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - font-size: 24px; - margin: 0 0 10px 0; - padding: 0; - line-height: 1; -} - -div.admonition p.last { - margin-bottom: 0; -} - -div.highlight { - background-color: #fff; -} - -dt:target, .highlight { - background: #FAF3E8; -} - -div.warning { - background-color: #FCC; - border: 1px solid #FAA; -} - -div.danger { - background-color: #FCC; - border: 1px solid #FAA; - -moz-box-shadow: 2px 2px 4px #D52C2C; - -webkit-box-shadow: 2px 2px 4px #D52C2C; - box-shadow: 2px 2px 4px #D52C2C; -} - -div.error { - background-color: #FCC; - border: 1px solid #FAA; - -moz-box-shadow: 2px 2px 4px #D52C2C; - -webkit-box-shadow: 2px 2px 4px #D52C2C; - box-shadow: 2px 2px 4px #D52C2C; -} - -div.caution { - background-color: #FCC; - border: 1px solid #FAA; -} - -div.attention { - background-color: #FCC; - border: 1px solid #FAA; -} - -div.important { - background-color: #EEE; - border: 1px solid #CCC; -} - -div.note { - background-color: #EEE; - border: 1px solid #CCC; -} - -div.tip { - background-color: #EEE; - border: 1px solid #CCC; -} - -div.hint { - background-color: #EEE; - border: 1px solid #CCC; -} - -div.seealso { - background-color: #EEE; - border: 1px solid #CCC; -} - -div.topic { - background-color: #EEE; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre, tt, code { - font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; - font-size: 0.9em; -} - -.hll { - background-color: #FFC; - margin: 0 -12px; - padding: 0 12px; - display: block; -} - -img.screenshot { -} - -tt.descname, tt.descclassname, code.descname, code.descclassname { - font-size: 0.95em; -} - -tt.descname, code.descname { - padding-right: 0.08em; -} - -img.screenshot { - -moz-box-shadow: 2px 2px 4px #EEE; - -webkit-box-shadow: 2px 2px 4px #EEE; - box-shadow: 2px 2px 4px #EEE; -} - -table.docutils { - border: 1px solid #888; - -moz-box-shadow: 2px 2px 4px #EEE; - -webkit-box-shadow: 2px 2px 4px #EEE; - box-shadow: 2px 2px 4px #EEE; -} - -table.docutils td, table.docutils th { - border: 1px solid #888; - padding: 0.25em 0.7em; -} - -table.field-list, table.footnote { - border: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} - -table.footnote { - margin: 15px 0; - width: 100%; - border: 1px solid #EEE; - background: #FDFDFD; - font-size: 0.9em; -} - -table.footnote + table.footnote { - margin-top: -15px; - border-top: none; -} - -table.field-list th { - padding: 0 0.8em 0 0; -} - -table.field-list td { - padding: 0; -} - -table.field-list p { - margin-bottom: 0.8em; -} - -table.footnote td.label { - width: .1px; - padding: 0.3em 0 0.3em 0.5em; -} - -table.footnote td { - padding: 0.3em 0.5em; -} - -dl { - margin: 0; - padding: 0; -} - -dl dd { - margin-left: 30px; -} - -blockquote { - margin: 0 0 0 30px; - padding: 0; -} - -ul, ol { - /* Matches the 30px from the narrow-screen "li > ul" selector below */ - margin: 10px 0 10px 30px; - padding: 0; -} - -pre { - background: #EEE; - padding: 7px 30px; - margin: 15px 0px; - line-height: 1.3em; -} - -div.viewcode-block:target { - background: #ffd; -} - -dl pre, blockquote pre, li pre { - margin-left: 0; - padding-left: 30px; -} - -dl dl pre { - margin-left: -90px; - padding-left: 90px; -} - -tt, code { - background-color: #ecf0f3; - color: #222; - /* padding: 1px 2px; */ -} - -tt.xref, code.xref, a tt { - background-color: #FBFBFB; - border-bottom: 1px solid #fff; -} - -a.reference { - text-decoration: none; - border-bottom: 1px dotted #004B6B; -} - -/* Don't put an underline on images */ -a.image-reference, a.image-reference:hover { - border-bottom: none; -} - -a.reference:hover { - border-bottom: 1px solid #6D4100; -} - -a.footnote-reference { - text-decoration: none; - font-size: 0.7em; - vertical-align: top; - border-bottom: 1px dotted #004B6B; -} - -a.footnote-reference:hover { - border-bottom: 1px solid #6D4100; -} - -a:hover tt, a:hover code { - background: #EEE; -} - - -@media screen and (max-width: 870px) { - - div.sphinxsidebar { - display: none; - } - - div.document { - width: 100%; - - } - - div.documentwrapper { - margin-left: 0; - margin-top: 0; - margin-right: 0; - margin-bottom: 0; - } - - div.bodywrapper { - margin-top: 0; - margin-right: 0; - margin-bottom: 0; - margin-left: 0; - } - - ul { - margin-left: 0; - } - - li > ul { - /* Matches the 30px from the "ul, ol" selector above */ - margin-left: 30px; - } - - .document { - width: auto; - } - - .footer { - width: auto; - } - - .bodywrapper { - margin: 0; - } - - .footer { - width: auto; - } - - .github { - display: none; - } - - - -} - - - -@media screen and (max-width: 875px) { - - body { - margin: 0; - padding: 20px 30px; - } - - div.documentwrapper { - float: none; - background: #fff; - } - - div.sphinxsidebar { - display: block; - float: none; - width: 102.5%; - margin: 50px -30px -20px -30px; - padding: 10px 20px; - background: #333; - color: #FFF; - } - - div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p, - div.sphinxsidebar h3 a { - color: #fff; - } - - div.sphinxsidebar a { - color: #AAA; - } - - div.sphinxsidebar p.logo { - display: none; - } - - div.document { - width: 100%; - margin: 0; - } - - div.footer { - display: none; - } - - div.bodywrapper { - margin: 0; - } - - div.body { - min-height: 0; - padding: 0; - } - - .rtd_doc_footer { - display: none; - } - - .document { - width: auto; - } - - .footer { - width: auto; - } - - .footer { - width: auto; - } - - .github { - display: none; - } -} - - -/* misc. */ - -.revsys-inline { - display: none!important; -} - -/* Make nested-list/multi-paragraph items look better in Releases changelog - * pages. Without this, docutils' magical list fuckery causes inconsistent - * formatting between different release sub-lists. - */ -div#changelog > div.section > ul > li > p:only-child { - margin-bottom: 0; -} - -/* Hide fugly table cell borders in ..bibliography:: directive output */ -table.docutils.citation, table.docutils.citation td, table.docutils.citation th { - border: none; - /* Below needed in some edge cases; if not applied, bottom shadows appear */ - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/basic.css mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/basic.css --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/basic.css 2016-11-29 15:44:05.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/basic.css 1970-01-01 00:00:00.000000000 +0000 @@ -1,611 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; - word-wrap: break-word; - overflow-wrap : break-word; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar #searchbox input[type="text"] { - width: 170px; -} - -img { - border: 0; - max-width: 100%; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable dl, table.indextable dd { - margin-top: 0; - margin-bottom: 0; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- general body styles --------------------------------------------------- */ - -div.body p, div.body dd, div.body li, div.body blockquote { - -moz-hyphens: auto; - -ms-hyphens: auto; - -webkit-hyphens: auto; - hyphens: auto; -} - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink, -caption:hover > a.headerlink, -p.caption:hover > a.headerlink, -div.code-block-caption:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.field-list ul { - padding-left: 1em; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px 7px 0 7px; - background-color: #ffe; - width: 40%; - float: right; -} - -p.sidebar-title { - font-weight: bold; -} - -/* -- topics ---------------------------------------------------------------- */ - -div.topic { - border: 1px solid #ccc; - padding: 7px 7px 0 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -div.admonition dl { - margin-bottom: 0; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - border: 0; - border-collapse: collapse; -} - -table caption span.caption-number { - font-style: italic; -} - -table caption span.caption-text { -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -table.field-list td, table.field-list th { - border: 0 !important; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -/* -- figures --------------------------------------------------------------- */ - -div.figure { - margin: 0.5em; - padding: 0.5em; -} - -div.figure p.caption { - padding: 0.3em; -} - -div.figure p.caption span.caption-number { - font-style: italic; -} - -div.figure p.caption span.caption-text { -} - - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -dl { - margin-bottom: 15px; -} - -dd p { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dt:target, .highlighted { - background-color: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.optional { - font-size: 1.3em; -} - -.sig-paren { - font-size: larger; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -abbr, acronym { - border-bottom: dotted 1px; - cursor: help; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -span.pre { - -moz-hyphens: none; - -ms-hyphens: none; - -webkit-hyphens: none; - hyphens: none; -} - -td.linenos pre { - padding: 5px 0px; - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - margin-left: 0.5em; -} - -table.highlighttable td { - padding: 0 0.5em 0 0.5em; -} - -div.code-block-caption { - padding: 2px 5px; - font-size: small; -} - -div.code-block-caption code { - background-color: transparent; -} - -div.code-block-caption + div > div.highlight > pre { - margin-top: 0; -} - -div.code-block-caption span.caption-number { - padding: 0.1em 0.3em; - font-style: italic; -} - -div.code-block-caption span.caption-text { -} - -div.literal-block-wrapper { - padding: 1em 1em 0; -} - -div.literal-block-wrapper div.highlight { - margin: 0; -} - -code.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -code.descclassname { - background-color: transparent; -} - -code.xref, a code { - background-color: transparent; - font-weight: bold; -} - -h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} \ No newline at end of file Binary files /tmp/tmpNoYn47/ajGK50spUe/mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/comment-bright.png and /tmp/tmpNoYn47/vW_aZbQ35_/mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/comment-bright.png differ Binary files /tmp/tmpNoYn47/ajGK50spUe/mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/comment-close.png and /tmp/tmpNoYn47/vW_aZbQ35_/mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/comment-close.png differ Binary files /tmp/tmpNoYn47/ajGK50spUe/mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/comment.png and /tmp/tmpNoYn47/vW_aZbQ35_/mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/comment.png differ diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/custom.css mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/custom.css --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/custom.css 2016-10-24 11:18:33.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/custom.css 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -/* This file intentionally left blank. */ diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/default.css mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/default.css --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/default.css 2014-01-20 08:16:09.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/default.css 1970-01-01 00:00:00.000000000 +0000 @@ -1,256 +0,0 @@ -/* - * default.css_t - * ~~~~~~~~~~~~~ - * - * Sphinx stylesheet -- default theme. - * - * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: sans-serif; - font-size: 100%; - background-color: #11303d; - color: #000; - margin: 0; - padding: 0; -} - -div.document { - background-color: #1c4e63; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 230px; -} - -div.body { - background-color: #ffffff; - color: #000000; - padding: 0 20px 30px 20px; -} - -div.footer { - color: #ffffff; - width: 100%; - padding: 9px 0 9px 0; - text-align: center; - font-size: 75%; -} - -div.footer a { - color: #ffffff; - text-decoration: underline; -} - -div.related { - background-color: #133f52; - line-height: 30px; - color: #ffffff; -} - -div.related a { - color: #ffffff; -} - -div.sphinxsidebar { -} - -div.sphinxsidebar h3 { - font-family: 'Trebuchet MS', sans-serif; - color: #ffffff; - font-size: 1.4em; - font-weight: normal; - margin: 0; - padding: 0; -} - -div.sphinxsidebar h3 a { - color: #ffffff; -} - -div.sphinxsidebar h4 { - font-family: 'Trebuchet MS', sans-serif; - color: #ffffff; - font-size: 1.3em; - font-weight: normal; - margin: 5px 0 0 0; - padding: 0; -} - -div.sphinxsidebar p { - color: #ffffff; -} - -div.sphinxsidebar p.topless { - margin: 5px 10px 10px 10px; -} - -div.sphinxsidebar ul { - margin: 10px; - padding: 0; - color: #ffffff; -} - -div.sphinxsidebar a { - color: #98dbcc; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - - - -/* -- hyperlink styles ------------------------------------------------------ */ - -a { - color: #355f7c; - text-decoration: none; -} - -a:visited { - color: #355f7c; - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - - - -/* -- body styles ----------------------------------------------------------- */ - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: 'Trebuchet MS', sans-serif; - background-color: #f2f2f2; - font-weight: normal; - color: #20435c; - border-bottom: 1px solid #ccc; - margin: 20px -20px 10px -20px; - padding: 3px 0 3px 10px; -} - -div.body h1 { margin-top: 0; font-size: 200%; } -div.body h2 { font-size: 160%; } -div.body h3 { font-size: 140%; } -div.body h4 { font-size: 120%; } -div.body h5 { font-size: 110%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: #c60f0f; - font-size: 0.8em; - padding: 0 4px 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - background-color: #c60f0f; - color: white; -} - -div.body p, div.body dd, div.body li { - text-align: justify; - line-height: 130%; -} - -div.admonition p.admonition-title + p { - display: inline; -} - -div.admonition p { - margin-bottom: 5px; -} - -div.admonition pre { - margin-bottom: 5px; -} - -div.admonition ul, div.admonition ol { - margin-bottom: 5px; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -div.warning { - background-color: #ffe4e4; - border: 1px solid #f66; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre { - padding: 5px; - background-color: #eeffcc; - color: #333333; - line-height: 120%; - border: 1px solid #ac9; - border-left: none; - border-right: none; -} - -tt { - background-color: #ecf0f3; - padding: 0 1px 0 1px; - font-size: 0.95em; -} - -th { - background-color: #ede; -} - -.warning tt { - background: #efc2c2; -} - -.note tt { - background: #d6d6d6; -} - -.viewcode-back { - font-family: sans-serif; -} - -div.viewcode-block:target { - background-color: #f4debf; - border-top: 1px solid #ac9; - border-bottom: 1px solid #ac9; -} \ No newline at end of file diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/doctools.js mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/doctools.js --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/doctools.js 2016-11-29 15:44:05.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/doctools.js 1970-01-01 00:00:00.000000000 +0000 @@ -1,287 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Sphinx JavaScript utilities for all documentation. - * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - -/** - * make the code below compatible with browsers without - * an installed firebug like debugger -if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", - "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", - "profile", "profileEnd"]; - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -} - */ - -/** - * small helper function to urldecode strings - */ -jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); -}; - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s == 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node) { - if (node.nodeType == 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { - var span = document.createElement("span"); - span.className = className; - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this); - }); - } - } - return this.each(function() { - highlight(this); - }); -}; - -/* - * backward compatibility for jQuery.browser - * This will be supported until firefox bug is fixed. - */ -if (!jQuery.browser) { - jQuery.uaMatch = function(ua) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || - /(webkit)[ \/]([\w.]+)/.exec(ua) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(msie) ([\w.]+)/.exec(ua) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - jQuery.browser = {}; - jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; -} - -/** - * Small JavaScript module for the documentation. - */ -var Documentation = { - - init : function() { - this.fixFirefoxAnchorBug(); - this.highlightSearchWords(); - this.initIndexTable(); - - }, - - /** - * i18n support - */ - TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, - LOCALE : 'unknown', - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext : function(string) { - var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated == 'undefined') - return string; - return (typeof translated == 'string') ? translated : translated[0]; - }, - - ngettext : function(singular, plural, n) { - var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated == 'undefined') - return (n == 1) ? singular : plural; - return translated[Documentation.PLURALEXPR(n)]; - }, - - addTranslations : function(catalog) { - for (var key in catalog.messages) - this.TRANSLATIONS[key] = catalog.messages[key]; - this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); - this.LOCALE = catalog.locale; - }, - - /** - * add context elements like header anchor links - */ - addContextElements : function() { - $('div[id] > :header:first').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this headline')). - appendTo(this); - }); - $('dt[id]').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this definition')). - appendTo(this); - }); - }, - - /** - * workaround a firefox stupidity - * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 - */ - fixFirefoxAnchorBug : function() { - if (document.location.hash) - window.setTimeout(function() { - document.location.href += ''; - }, 10); - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords : function() { - var params = $.getQueryParameters(); - var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; - if (terms.length) { - var body = $('div.body'); - if (!body.length) { - body = $('body'); - } - window.setTimeout(function() { - $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlighted'); - }); - }, 10); - $('') - .appendTo($('#searchbox')); - } - }, - - /** - * init the domain index toggle buttons - */ - initIndexTable : function() { - var togglers = $('img.toggler').click(function() { - var src = $(this).attr('src'); - var idnum = $(this).attr('id').substr(7); - $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) == 'minus.png') - $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); - else - $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); - }).css('display', ''); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { - togglers.click(); - } - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords : function() { - $('#searchbox .highlight-link').fadeOut(300); - $('span.highlighted').removeClass('highlighted'); - }, - - /** - * make the url absolute - */ - makeURL : function(relativeURL) { - return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; - }, - - /** - * get the current relative url - */ - getCurrentURL : function() { - var path = document.location.pathname; - var parts = path.split(/\//); - $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this == '..') - parts.pop(); - }); - var url = parts.join('/'); - return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - }, - - initOnKeyListeners: function() { - $(document).keyup(function(event) { - var activeElementType = document.activeElement.tagName; - // don't navigate when in search box or textarea - if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { - switch (event.keyCode) { - case 37: // left - var prevHref = $('link[rel="prev"]').prop('href'); - if (prevHref) { - window.location.href = prevHref; - return false; - } - case 39: // right - var nextHref = $('link[rel="next"]').prop('href'); - if (nextHref) { - window.location.href = nextHref; - return false; - } - } - } - }); - } -}; - -// quick alias for translations -_ = Documentation.gettext; - -$(document).ready(function() { - Documentation.init(); -}); \ No newline at end of file Binary files /tmp/tmpNoYn47/ajGK50spUe/mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/down.png and /tmp/tmpNoYn47/vW_aZbQ35_/mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/down.png differ Binary files /tmp/tmpNoYn47/ajGK50spUe/mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/down-pressed.png and /tmp/tmpNoYn47/vW_aZbQ35_/mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/down-pressed.png differ Binary files /tmp/tmpNoYn47/ajGK50spUe/mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/file.png and /tmp/tmpNoYn47/vW_aZbQ35_/mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/file.png differ diff -Nru mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/jquery-1.11.1.js mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/jquery-1.11.1.js --- mnemosyne-2.4/mnemosyne/libmnemosyne/docs/build/html/_static/jquery-1.11.1.js 2016-10-24 11:18:23.000000000 +0000 +++ mnemosyne-2.6+ds/mnemosyne/libmnemosyne/docs/build/html/_static/jquery-1.11.1.js 1970-01-01 00:00:00.000000000 +0000 @@ -1,10308 +0,0 @@ -/*! - * jQuery JavaScript Library v1.11.1 - * http://jquery.com/ - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * - * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2014-05-01T17:42Z - */ - -(function( global, factory ) { - - if ( typeof module === "object" && typeof module.exports === "object" ) { - // For CommonJS and CommonJS-like environments where a proper window is present, - // execute the factory and get jQuery - // For environments that do not inherently posses a window with a document - // (such as Node.js), expose a jQuery-making factory as module.exports - // This accentuates the need for the creation of a real window - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Can't do this because several apps including ASP.NET trace -// the stack via arguments.caller.callee and Firefox dies if -// you try to trace through "use strict" call chains. (#13335) -// Support: Firefox 18+ -// - -var deletedIds = []; - -var slice = deletedIds.slice; - -var concat = deletedIds.concat; - -var push = deletedIds.push; - -var indexOf = deletedIds.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var support = {}; - - - -var - version = "1.11.1", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }, - - // Support: Android<4.1, IE<9 - // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([\da-z])/gi, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }; - -jQuery.fn = jQuery.prototype = { - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // Start with an empty selector - selector: "", - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num != null ? - - // Return just the one element from the set - ( num < 0 ? this[ num + this.length ] : this[ num ] ) : - - // Return all the elements in a clean array - slice.call( this ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - ret.context = this.context; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: deletedIds.sort, - splice: deletedIds.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var src, copyIsArray, copy, name, options, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - isWindow: function( obj ) { - /* jshint eqeqeq: false */ - return obj != null && obj == obj.window; - }, - - isNumeric: function( obj ) { - // parseFloat NaNs numeric-cast false positives (null|true|false|"") - // ...but misinterprets leading-number strings, particularly hex literals ("0x...") - // subtraction forces infinities to NaN - return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0; - }, - - isEmptyObject: function( obj ) { - var name; - for ( name in obj ) { - return false; - } - return true; - }, - - isPlainObject: function( obj ) { - var key; - - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Support: IE<9 - // Handle iteration over inherited properties before own properties. - if ( support.ownLast ) { - for ( key in obj ) { - return hasOwn.call( obj, key ); - } - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - for ( key in obj ) {} - - return key === undefined || hasOwn.call( obj, key ); - }, - - type: function( obj ) { - if ( obj == null ) { - return obj + ""; - } - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call(obj) ] || "object" : - typeof obj; - }, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && jQuery.trim( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - }, - - // args is for internal usage only - each: function( obj, callback, args ) { - var value, - i = 0, - length = obj.length, - isArray = isArraylike( obj ); - - if ( args ) { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } - } - - return obj; - }, - - // Support: Android<4.1, IE<9 - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArraylike( Object(arr) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - var len; - - if ( arr ) { - if ( indexOf ) { - return indexOf.call( arr, elem, i ); - } - - len = arr.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in arr && arr[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - while ( j < len ) { - first[ i++ ] = second[ j++ ]; - } - - // Support: IE<9 - // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) - if ( len !== len ) { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, - i = 0, - length = elems.length, - isArray = isArraylike( elems ), - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var args, proxy, tmp; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - now: function() { - return +( new Date() ); - }, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -}); - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -function isArraylike( obj ) { - var length = obj.length, - type = jQuery.type( obj ); - - if ( type === "function" || jQuery.isWindow( obj ) ) { - return false; - } - - if ( obj.nodeType === 1 && length ) { - return true; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v1.10.19 - * http://sizzlejs.com/ - * - * Copyright 2013 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2014-04-18 - */ -(function( window ) { - -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + -(new Date()), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // General-purpose constants - strundefined = typeof undefined, - MAX_NEGATIVE = 1 << 31, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf if we can't use a native one - indexOf = arr.indexOf || function( elem ) { - var i = 0, - len = this.length; - for ( ; i < len; i++ ) { - if ( this[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + - "*\\]", - - pseudos = ":(" + characterEncoding + ")(?:\\((" + - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - rescape = /'|\\/g, - - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox<24 - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - high < 0 ? - // BMP codepoint - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }; - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - - context = context || document; - results = results || []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { - return []; - } - - if ( documentIsHTML && !seed ) { - - // Shortcuts - if ( (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document (jQuery #6963) - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; - } - } - - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // QSA path - if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - nid = old = expando; - newContext = context; - newSelector = nodeType === 9 && selector; - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); - - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; - - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); - } - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; - newSelector = groups.join(","); - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key + " " ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result - */ -function assert( fn ) { - var div = document.createElement("div"); - - try { - return !!fn( div ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( div.parentNode ) { - div.parentNode.removeChild( div ); - } - // release memory in IE - div = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = attrs.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - ( ~b.sourceIndex || MAX_NEGATIVE ) - - ( ~a.sourceIndex || MAX_NEGATIVE ); - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== strundefined && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, - doc = node ? node.ownerDocument || node : preferredDoc, - parent = doc.defaultView; - - // If no document and documentElement is available, return - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Set our document - document = doc; - docElem = doc.documentElement; - - // Support tests - documentIsHTML = !isXML( doc ); - - // Support: IE>8 - // If iframe document is assigned to "document" variable and if iframe has been reloaded, - // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 - // IE6-8 do not support the defaultView property so parent will be undefined - if ( parent && parent !== parent.top ) { - // IE11 does not have attachEvent, so all must suffer - if ( parent.addEventListener ) { - parent.addEventListener( "unload", function() { - setDocument(); - }, false ); - } else if ( parent.attachEvent ) { - parent.attachEvent( "onunload", function() { - setDocument(); - }); - } - } - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) - support.attributes = assert(function( div ) { - div.className = "i"; - return !div.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( div ) { - div.appendChild( doc.createComment("") ); - return !div.getElementsByTagName("*").length; - }); - - // Check if getElementsByClassName can be trusted - support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) { - div.innerHTML = "
"; - - // Support: Safari<4 - // Catch class over-caching - div.firstChild.className = "i"; - // Support: Opera<10 - // Catch gEBCN failure to find non-leading classes - return div.getElementsByClassName("i").length === 2; - }); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( div ) { - docElem.appendChild( div ).id = expando; - return !doc.getElementsByName || !doc.getElementsByName( expando ).length; - }); - - // ID find and filter - if ( support.getById ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && documentIsHTML ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [ m ] : []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - } else { - // Support: IE6/7 - // getElementById is not reliable as a find shortcut - delete Expr.find["ID"]; - - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== strundefined ) { - return context.getElementsByTagName( tag ); - } - } : - function( tag, context ) { - var elem, - tmp = [], - i = 0, - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See http://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( div ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - div.innerHTML = ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( div.querySelectorAll("[msallowclip^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - }); - - assert(function( div ) { - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = doc.createElement("input"); - input.setAttribute( "type", "hidden" ); - div.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( div.querySelectorAll("[name=d]").length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":enabled").length ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( div ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( div, "div" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( div, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully does not implement inclusive descendent - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { - return -1; - } - if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return doc; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - if ( support.matchesSelector && documentIsHTML && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch(e) {} - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? - val.value : - null; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - while ( (node = elem[i++]) ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[6] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[3] ) { - match[2] = match[4] || match[5] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { return true; } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); - cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) - } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf.call( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( (tokens = []) ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push({ - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push({ - value: matched, - type: type, - matches: match - }); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - checkNonElements = base && dir === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (oldCache = outerCache[ dir ]) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return (newCache[ 2 ] = oldCache[ 2 ]); - } else { - // Reuse newcache so results back-propagate to previous elements - outerCache[ dir ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { - return true; - } - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf.call( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), - len = elems.length; - - if ( outermost ) { - outermostContext = context !== document && context; - } - - // Add elements passing elementMatchers directly to results - // Keep `i` a string if there are no elements so `matchedCount` will be "00" below - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // Apply set filters to unmatched elements - matchedCount += i; - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( (selector = compiled.selector || selector) ); - - results = results || []; - - // Try to minimize operations if there is no seed and only one group - if ( match.length === 1 ) { - - // Take a shortcut and set the context if the root selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - support.getById && context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Support: Chrome<14 -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( div1 ) { - // Should return 1, but returns 4 (following) - return div1.compareDocumentPosition( document.createElement("div") ) & 1; -}); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( div ) { - div.innerHTML = ""; - return div.firstChild.getAttribute("href") === "#" ; -}) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - }); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( div ) { - div.innerHTML = ""; - div.firstChild.setAttribute( "value", "" ); - return div.firstChild.getAttribute( "value" ) === ""; -}) ) { - addHandle( "value", function( elem, name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - }); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( div ) { - return div.getAttribute("disabled") == null; -}) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - (val = elem.getAttributeNode( name )) && val.specified ? - val.value : - null; - } - }); -} - -return Sizzle; - -})( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.pseudos; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - - -var rneedsContext = jQuery.expr.match.needsContext; - -var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); - - - -var risSimple = /^.[^:#\[\.,]*$/; - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - /* jshint -W018 */ - return !!qualifier.call( elem, i, elem ) !== not; - }); - - } - - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - }); - - } - - if ( typeof qualifier === "string" ) { - if ( risSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - qualifier = jQuery.filter( qualifier, elements ); - } - - return jQuery.grep( elements, function( elem ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; - }); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 && elem.nodeType === 1 ? - jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : - jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - })); -}; - -jQuery.fn.extend({ - find: function( selector ) { - var i, - ret = [], - self = this, - len = self.length; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }) ); - } - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - // Needed because $( selector, context ) becomes $( context ).find( selector ) - ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); - ret.selector = this.selector ? this.selector + " " + selector : selector; - return ret; - }, - filter: function( selector ) { - return this.pushStack( winnow(this, selector || [], false) ); - }, - not: function( selector ) { - return this.pushStack( winnow(this, selector || [], true) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -}); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // Use the correct document accordingly with window argument (sandbox) - document = window.document, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, - - init = jQuery.fn.init = function( selector, context ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - - // scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[1], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return typeof rootjQuery.ready !== "undefined" ? - rootjQuery.ready( selector ) : - // Execute immediately if ready is not present - selector( jQuery ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.extend({ - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -jQuery.fn.extend({ - has: function( target ) { - var i, - targets = jQuery( target, this ), - len = targets.length; - - return this.filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( ; i < l; i++ ) { - for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { - // Always skip document fragments - if ( cur.nodeType < 11 && (pos ? - pos.index(cur) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector(cur, selectors)) ) { - - matched.push( cur ); - break; - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.unique( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter(selector) - ); - } -}); - -function sibling( cur, dir ) { - do { - cur = cur[ dir ]; - } while ( cur && cur.nodeType !== 1 ); - - return cur; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - if ( this.length > 1 ) { - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - ret = jQuery.unique( ret ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - } - - return this.pushStack( ret ); - }; -}); -var rnotwhite = (/\S+/g); - - - -// String to Object options format cache -var optionsCache = {}; - -// Convert String-formatted options into Object-formatted ones and store in cache -function createOptions( options ) { - var object = optionsCache[ options ] = {}; - jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { - object[ flag ] = true; - }); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - ( optionsCache[ options ] || createOptions( options ) ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list was already fired - fired, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // First callback to fire (used internally by add and fireWith) - firingStart, - // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = !options.once && [], - // Fire callbacks - fire = function( data ) { - memory = options.memory && data; - fired = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - firing = true; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { - memory = false; // To prevent further calls using add - break; - } - } - firing = false; - if ( list ) { - if ( stack ) { - if ( stack.length ) { - fire( stack.shift() ); - } - } else if ( memory ) { - list = []; - } else { - self.disable(); - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - // First, we save the current length - var start = list.length; - (function add( args ) { - jQuery.each( args, function( _, arg ) { - var type = jQuery.type( arg ); - if ( type === "function" ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && type !== "string" ) { - // Inspect recursively - add( arg ); - } - }); - })( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away - } else if ( memory ) { - firingStart = start; - fire( memory ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - // Handle firing indexes - if ( firing ) { - if ( index <= firingLength ) { - firingLength--; - } - if ( index <= firingIndex ) { - firingIndex--; - } - } - } - }); - } - return this; - }, - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); - }, - // Remove all callbacks from the list - empty: function() { - list = []; - firingLength = 0; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( list && ( !fired || stack ) ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - if ( firing ) { - stack.push( args ); - } else { - fire( args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -jQuery.extend({ - - Deferred: function( func ) { - var tuples = [ - // action, add listener, listener list, final state - [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], - [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], - [ "notify", "progress", jQuery.Callbacks("memory") ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - then: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - return jQuery.Deferred(function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; - // deferred[ done | fail | progress ] for forwarding actions to newDefer - deferred[ tuple[1] ](function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .done( newDefer.resolve ) - .fail( newDefer.reject ) - .progress( newDefer.notify ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); - } - }); - }); - fns = null; - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Keep pipe for back-compat - promise.pipe = promise.then; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 3 ]; - - // promise[ done | fail | progress ] = list.add - promise[ tuple[1] ] = list.add; - - // Handle state - if ( stateString ) { - list.add(function() { - // state = [ resolved | rejected ] - state = stateString; - - // [ reject_list | resolve_list ].disable; progress_list.lock - }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); - } - - // deferred[ resolve | reject | notify ] - deferred[ tuple[0] ] = function() { - deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); - return this; - }; - deferred[ tuple[0] + "With" ] = list.fireWith; - }); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( subordinate /* , ..., subordinateN */ ) { - var i = 0, - resolveValues = slice.call( arguments ), - length = resolveValues.length, - - // the count of uncompleted subordinates - remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, - - // the master Deferred. If resolveValues consist of only a single Deferred, just use that. - deferred = remaining === 1 ? subordinate : jQuery.Deferred(), - - // Update function for both resolve and progress values - updateFunc = function( i, contexts, values ) { - return function( value ) { - contexts[ i ] = this; - values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( values === progressValues ) { - deferred.notifyWith( contexts, values ); - - } else if ( !(--remaining) ) { - deferred.resolveWith( contexts, values ); - } - }; - }, - - progressValues, progressContexts, resolveContexts; - - // add listeners to Deferred subordinates; treat others as resolved - if ( length > 1 ) { - progressValues = new Array( length ); - progressContexts = new Array( length ); - resolveContexts = new Array( length ); - for ( ; i < length; i++ ) { - if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { - resolveValues[ i ].promise() - .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ) - .progress( updateFunc( i, progressContexts, progressValues ) ); - } else { - --remaining; - } - } - } - - // if we're not waiting on anything, resolve the master - if ( !remaining ) { - deferred.resolveWith( resolveContexts, resolveValues ); - } - - return deferred.promise(); - } -}); - - -// The deferred used on DOM ready -var readyList; - -jQuery.fn.ready = function( fn ) { - // Add the callback - jQuery.ready.promise().done( fn ); - - return this; -}; - -jQuery.extend({ - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.triggerHandler ) { - jQuery( document ).triggerHandler( "ready" ); - jQuery( document ).off( "ready" ); - } - } -}); - -/** - * Clean-up method for dom ready events - */ -function detach() { - if ( document.addEventListener ) { - document.removeEventListener( "DOMContentLoaded", completed, false ); - window.removeEventListener( "load", completed, false ); - - } else { - document.detachEvent( "onreadystatechange", completed ); - window.detachEvent( "onload", completed ); - } -} - -/** - * The ready event handler and self cleanup method - */ -function completed() { - // readyState === "complete" is good enough for us to call the dom ready in oldIE - if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { - detach(); - jQuery.ready(); - } -} - -jQuery.ready.promise = function( obj ) { - if ( !readyList ) { - - readyList = jQuery.Deferred(); - - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - setTimeout( jQuery.ready ); - - // Standards-based browsers support DOMContentLoaded - } else if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed, false ); - - // If IE event model is used - } else { - // Ensure firing before onload, maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", completed ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", completed ); - - // If IE and not a frame - // continually check to see if the document is ready - var top = false; - - try { - top = window.frameElement == null && document.documentElement; - } catch(e) {} - - if ( top && top.doScroll ) { - (function doScrollCheck() { - if ( !jQuery.isReady ) { - - try { - // Use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - top.doScroll("left"); - } catch(e) { - return setTimeout( doScrollCheck, 50 ); - } - - // detach all dom ready events - detach(); - - // and execute any waiting functions - jQuery.ready(); - } - })(); - } - } - } - return readyList.promise( obj ); -}; - - -var strundefined = typeof undefined; - - - -// Support: IE<9 -// Iteration over object's inherited properties before its own -var i; -for ( i in jQuery( support ) ) { - break; -} -support.ownLast = i !== "0"; - -// Note: most support tests are defined in their respective modules. -// false until the test is run -support.inlineBlockNeedsLayout = false; - -// Execute ASAP in case we need to set body.style.zoom -jQuery(function() { - // Minified: var a,b,c,d - var val, div, body, container; - - body = document.getElementsByTagName( "body" )[ 0 ]; - if ( !body || !body.style ) { - // Return for frameset docs that don't have a body - return; - } - - // Setup - div = document.createElement( "div" ); - container = document.createElement( "div" ); - container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; - body.appendChild( container ).appendChild( div ); - - if ( typeof div.style.zoom !== strundefined ) { - // Support: IE<8 - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; - - support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; - if ( val ) { - // Prevent IE 6 from affecting layout for positioned elements #11048 - // Prevent IE from shrinking the body in IE 7 mode #12869 - // Support: IE<8 - body.style.zoom = 1; - } - } - - body.removeChild( container ); -}); - - - - -(function() { - var div = document.createElement( "div" ); - - // Execute the test only if not already executed in another module. - if (support.deleteExpando == null) { - // Support: IE<9 - support.deleteExpando = true; - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - } - - // Null elements to avoid leaks in IE. - div = null; -})(); - - -/** - * Determines whether an object can have data - */ -jQuery.acceptData = function( elem ) { - var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ], - nodeType = +elem.nodeType || 1; - - // Do not set data on non-element DOM nodes because it will not be cleared (#8335). - return nodeType !== 1 && nodeType !== 9 ? - false : - - // Nodes accept data unless otherwise specified; rejection can be conditional - !noData || noData !== true && elem.getAttribute("classid") === noData; -}; - - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /([A-Z])/g; - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - // Only convert to a number if it doesn't change the string - +data + "" === data ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - var name; - for ( name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} - -function internalData( elem, name, data, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var ret, thisCache, - internalKey = jQuery.expando, - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; - } else { - id = internalKey; - } - } - - if ( !cache[ id ] ) { - // Avoid exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( typeof name === "string" ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; -} - -function internalRemoveData( elem, name, pvt ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, i, - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support array or space separated string names for data keys - if ( !jQuery.isArray( name ) ) { - - // try the string as a key before any manipulation - if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces unless a key with the spaces exists - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split(" "); - } - } - } else { - // If "name" is an array of keys... - // When data is initially created, via ("key", "val") signature, - // keys will be converted to camelCase. - // Since there is no way to tell _how_ a key was added, remove - // both plain key and camelCase key. #12786 - // This will only penalize the array argument path. - name = name.concat( jQuery.map( name, jQuery.camelCase ) ); - } - - i = name.length; - while ( i-- ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject( cache[ id ] ) ) { - return; - } - } - - // Destroy the cache - if ( isNode ) { - jQuery.cleanData( [ elem ], true ); - - // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) - /* jshint eqeqeq: false */ - } else if ( support.deleteExpando || cache != cache.window ) { - /* jshint eqeqeq: true */ - delete cache[ id ]; - - // When all else fails, null - } else { - cache[ id ] = null; - } -} - -jQuery.extend({ - cache: {}, - - // The following elements (space-suffixed to avoid Object.prototype collisions) - // throw uncatchable exceptions if you attempt to set expando properties - noData: { - "applet ": true, - "embed ": true, - // ...but Flash objects (which have this classid) *can* handle expandos - "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data ) { - return internalData( elem, name, data ); - }, - - removeData: function( elem, name ) { - return internalRemoveData( elem, name ); - }, - - // For internal use only. - _data: function( elem, name, data ) { - return internalData( elem, name, data, true ); - }, - - _removeData: function( elem, name ) { - return internalRemoveData( elem, name, true ); - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var i, name, data, - elem = this[0], - attrs = elem && elem.attributes; - - // Special expections of .data basically thwart jQuery.access, - // so implement the relevant behavior ourselves - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = jQuery.data( elem ); - - if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE11+ - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.slice(5) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - jQuery._data( elem, "parsedAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - return arguments.length > 1 ? - - // Sets one value - this.each(function() { - jQuery.data( this, key, value ); - }) : - - // Gets one value - // Try to fetch any internally stored data first - elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - - -jQuery.extend({ - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || jQuery.isArray(data) ) { - queue = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // not intended for public consumption - generates a queueHooks object, or returns the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return jQuery._data( elem, key ) || jQuery._data( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { - jQuery._removeData( elem, type + "queue" ); - jQuery._removeData( elem, key ); - }) - }); - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); - } - - return data === undefined ? - this : - this.each(function() { - var queue = jQuery.queue( this, type, data ); - - // ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = jQuery._data( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -}); -var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var isHidden = function( elem, el ) { - // isHidden might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); - }; - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - length = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < length; i++ ) { - fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); - } - } - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - length ? fn( elems[0], key ) : emptyGet; -}; -var rcheckableType = (/^(?:checkbox|radio)$/i); - - - -(function() { - // Minified: var a,b,c - var input = document.createElement( "input" ), - div = document.createElement( "div" ), - fragment = document.createDocumentFragment(); - - // Setup - div.innerHTML = "
a"; - - // IE strips leading whitespace when .innerHTML is used - support.leadingWhitespace = div.firstChild.nodeType === 3; - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - support.tbody = !div.getElementsByTagName( "tbody" ).length; - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; - - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - support.html5Clone = - document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav>"; - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - input.type = "checkbox"; - input.checked = true; - fragment.appendChild( input ); - support.appendChecked = input.checked; - - // Make sure textarea (and checkbox) defaultValue is properly cloned - // Support: IE6-IE11+ - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; - - // #11217 - WebKit loses check when the name is after the checked attribute - fragment.appendChild( div ); - div.innerHTML = ""; - - // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 - // old WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE<9 - // Opera does not clone events (and typeof div.attachEvent === undefined). - // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() - support.noCloneEvent = true; - if ( div.attachEvent ) { - div.attachEvent( "onclick", function() { - support.noCloneEvent = false; - }); - - div.cloneNode( true ).click(); - } - - // Execute the test only if not already executed in another module. - if (support.deleteExpando == null) { - // Support: IE<9 - support.deleteExpando = true; - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - } -})(); - - -(function() { - var i, eventName, - div = document.createElement( "div" ); - - // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event) - for ( i in { submit: true, change: true, focusin: true }) { - eventName = "on" + i; - - if ( !(support[ i + "Bubbles" ] = eventName in window) ) { - // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) - div.setAttribute( eventName, "t" ); - support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false; - } - } - - // Null elements to avoid leaks in IE. - div = null; -})(); - - -var rformElems = /^(?:input|select|textarea)$/i, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - var tmp, events, t, handleObjIn, - special, eventHandle, handleObj, - handlers, type, namespaces, origType, - elemData = jQuery._data( elem ); - - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !(events = elemData.events) ) { - events = elemData.events = {}; - } - if ( !(eventHandle = elemData.handle) ) { - eventHandle = elemData.handle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !(handlers = events[ type ]) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - var j, handleObj, tmp, - origCount, t, events, - special, handlers, type, - namespaces, origType, - elemData = jQuery.hasData( elem ) && jQuery._data( elem ); - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - delete elemData.handle; - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery._removeData( elem, "events" ); - } - }, - - trigger: function( event, data, elem, onlyHandlers ) { - var handle, ontype, cur, - bubbleType, special, tmp, i, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; - - cur = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf(".") >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf(":") < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join("."); - event.namespace_re = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === (elem.ownerDocument || document) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && jQuery.acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && - jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - try { - elem[ type ](); - } catch ( e ) { - // IE<9 dies on focus/blur to hidden element (#1486,#12518) - // only reproducible on winXP IE8 native, not IE9 in IE8 mode - } - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event ); - - var i, ret, handleObj, matched, j, - handlerQueue = [], - args = slice.call( arguments ), - handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { - - // Triggered event must either 1) have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( (event.result = ret) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var sel, handleObj, matches, i, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - // Black-hole SVG instance trees (#13180) - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { - - /* jshint eqeqeq: false */ - for ( ; cur != this; cur = cur.parentNode || this ) { - /* jshint eqeqeq: true */ - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matches[ sel ] === undefined ) { - matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) >= 0 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matches[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, handlers: matches }); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( delegateCount < handlers.length ) { - handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); - } - - return handlerQueue; - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, copy, - type = event.type, - originalEvent = event, - fixHook = this.fixHooks[ type ]; - - if ( !fixHook ) { - this.fixHooks[ type ] = fixHook = - rmouseEvent.test( type ) ? this.mouseHooks : - rkeyEvent.test( type ) ? this.keyHooks : - {}; - } - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = new jQuery.Event( originalEvent ); - - i = copy.length; - while ( i-- ) { - prop = copy[ i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Support: IE<9 - // Fix target property (#1925) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Support: Chrome 23+, Safari? - // Target should not be a text node (#504, #13143) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // Support: IE<9 - // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) - event.metaKey = !!event.metaKey; - - return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var body, eventDoc, doc, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - special: { - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - focus: { - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== safeActiveElement() && this.focus ) { - try { - this.focus(); - return false; - } catch ( e ) { - // Support: IE<9 - // If we error on focus to hidden element (#1486, #12518), - // let .trigger() run the handlers - } - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === safeActiveElement() && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, - click: { - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { - this.click(); - return false; - } - }, - - // For cross-browser consistency, don't fire native .click() on links - _default: function( event ) { - return jQuery.nodeName( event.target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - var name = "on" + type; - - if ( elem.detachEvent ) { - - // #8545, #7054, preventing memory leaks for custom events in IE6-8 - // detachEvent needed property on element, by name of that event, to properly expose it to GC - if ( typeof elem[ name ] === strundefined ) { - elem[ name ] = null; - } - - elem.detachEvent( name, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - // Support: IE < 9, Android < 4.0 - src.returnValue === false ? - returnTrue : - returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - if ( !e ) { - return; - } - - // If preventDefault exists, run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // Support: IE - // Otherwise set the returnValue property of the original event to false - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - if ( !e ) { - return; - } - // If stopPropagation exists, run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - - // Support: IE - // Set the cancelBubble property of the original event to true - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && e.stopImmediatePropagation ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !jQuery._data( form, "submitBubbles" ) ) { - jQuery.event.add( form, "submit._submit", function( event ) { - event._submit_bubble = true; - }); - jQuery._data( form, "submitBubbles", true ); - } - }); - // return undefined since we don't need an event listener - }, - - postDispatch: function( event ) { - // If form was submitted by the user, bubble the event up the tree - if ( event._submit_bubble ) { - delete event._submit_bubble; - if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - } - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed && !event.isTrigger ) { - this._just_changed = false; - } - // Allow triggered, simulated change events (#11500) - jQuery.event.simulate( "change", this, event, true ); - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - jQuery._data( elem, "changeBubbles", true ); - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return !rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - var doc = this.ownerDocument || this, - attaches = jQuery._data( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this, - attaches = jQuery._data( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - jQuery._removeData( doc, fix ); - } else { - jQuery._data( doc, fix, attaches ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var type, origFn; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - var elem = this[0]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -}); - - -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - -var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + - "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, - rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, - rtagName = /<([\w:]+)/, - rtbody = /\s*$/g, - - // We have to close these tags to support XHTML (#13200) - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
", "
" ], - area: [ 1, "", "" ], - param: [ 1, "", "" ], - thead: [ 1, "", "
" ], - tr: [ 2, "", "
" ], - col: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, - // unless wrapped in a div with non-breaking characters in front of it. - _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
", "
" ] - }, - safeFragment = createSafeFragment( document ), - fragmentDiv = safeFragment.appendChild( document.createElement("div") ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -function getAll( context, tag ) { - var elems, elem, - i = 0, - found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) : - typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) : - undefined; - - if ( !found ) { - for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { - if ( !tag || jQuery.nodeName( elem, tag ) ) { - found.push( elem ); - } else { - jQuery.merge( found, getAll( elem, tag ) ); - } - } - } - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], found ) : - found; -} - -// Used in buildFragment, fixes the defaultChecked property -function fixDefaultChecked( elem ) { - if ( rcheckableType.test( elem.type ) ) { - elem.defaultChecked = elem.checked; - } -} - -// Support: IE<8 -// Manipulating tables requires a tbody -function manipulationTarget( elem, content ) { - return jQuery.nodeName( elem, "table" ) && - jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? - - elem.getElementsByTagName("tbody")[0] || - elem.appendChild( elem.ownerDocument.createElement("tbody") ) : - elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - if ( match ) { - elem.type = match[1]; - } else { - elem.removeAttribute("type"); - } - return elem; -} - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var elem, - i = 0; - for ( ; (elem = elems[i]) != null; i++ ) { - jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); - } -} - -function cloneCopyEvent( src, dest ) { - - if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { - return; - } - - var type, i, l, - oldData = jQuery._data( src ), - curData = jQuery._data( dest, oldData ), - events = oldData.events; - - if ( events ) { - delete curData.handle; - curData.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - - // make the cloned public data object a copy from the original - if ( curData.data ) { - curData.data = jQuery.extend( {}, curData.data ); - } -} - -function fixCloneNodeIssues( src, dest ) { - var nodeName, e, data; - - // We do not need to do anything for non-Elements - if ( dest.nodeType !== 1 ) { - return; - } - - nodeName = dest.nodeName.toLowerCase(); - - // IE6-8 copies events bound via attachEvent when using cloneNode. - if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { - data = jQuery._data( dest ); - - for ( e in data.events ) { - jQuery.removeEvent( dest, e, data.handle ); - } - - // Event data gets referenced instead of copied if the expando gets copied too - dest.removeAttribute( jQuery.expando ); - } - - // IE blanks contents when cloning scripts, and tries to evaluate newly-set text - if ( nodeName === "script" && dest.text !== src.text ) { - disableScript( dest ).text = src.text; - restoreScript( dest ); - - // IE6-10 improperly clones children of object elements using classid. - // IE10 throws NoModificationAllowedError if parent is null, #12132. - } else if ( nodeName === "object" ) { - if ( dest.parentNode ) { - dest.outerHTML = src.outerHTML; - } - - // This path appears unavoidable for IE9. When cloning an object - // element in IE9, the outerHTML strategy above is not sufficient. - // If the src has innerHTML and the destination does not, - // copy the src.innerHTML into the dest.innerHTML. #10324 - if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { - dest.innerHTML = src.innerHTML; - } - - } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - // IE6-8 fails to persist the checked state of a cloned checkbox - // or radio button. Worse, IE6-7 fail to give the cloned element - // a checked appearance if the defaultChecked value isn't also set - - dest.defaultChecked = dest.checked = src.checked; - - // IE6-7 get confused and end up setting the value of a cloned - // checkbox/radio button to an empty string instead of "on" - if ( dest.value !== src.value ) { - dest.value = src.value; - } - - // IE6-8 fails to return the selected option to the default selected - // state when cloning options - } else if ( nodeName === "option" ) { - dest.defaultSelected = dest.selected = src.defaultSelected; - - // IE6-8 fails to set the defaultValue to the correct value when - // cloning other types of input fields - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -jQuery.extend({ - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var destElements, node, clone, i, srcElements, - inPage = jQuery.contains( elem.ownerDocument, elem ); - - if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { - clone = elem.cloneNode( true ); - - // IE<=8 does not properly clone detached, unknown element nodes - } else { - fragmentDiv.innerHTML = elem.outerHTML; - fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); - } - - if ( (!support.noCloneEvent || !support.noCloneChecked) && - (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { - - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - // Fix all IE cloning issues - for ( i = 0; (node = srcElements[i]) != null; ++i ) { - // Ensure that the destination node is not null; Fixes #9587 - if ( destElements[i] ) { - fixCloneNodeIssues( node, destElements[i] ); - } - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0; (node = srcElements[i]) != null; i++ ) { - cloneCopyEvent( node, destElements[i] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - destElements = srcElements = node = null; - - // Return the cloned set - return clone; - }, - - buildFragment: function( elems, context, scripts, selection ) { - var j, elem, contains, - tmp, tag, tbody, wrap, - l = elems.length, - - // Ensure a safe fragment - safe = createSafeFragment( context ), - - nodes = [], - i = 0; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || safe.appendChild( context.createElement("div") ); - - // Deserialize a standard representation - tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - - tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; - - // Descend through wrappers to the right content - j = wrap[0]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Manually add leading whitespace removed by IE - if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { - nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); - } - - // Remove IE's autoinserted from table fragments - if ( !support.tbody ) { - - // String was a , *may* have spurious - elem = tag === "table" && !rtbody.test( elem ) ? - tmp.firstChild : - - // String was a bare or - wrap[1] === "
" && !rtbody.test( elem ) ? - tmp : - 0; - - j = elem && elem.childNodes.length; - while ( j-- ) { - if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { - elem.removeChild( tbody ); - } - } - } - - jQuery.merge( nodes, tmp.childNodes ); - - // Fix #12392 for WebKit and IE > 9 - tmp.textContent = ""; - - // Fix #12392 for oldIE - while ( tmp.firstChild ) { - tmp.removeChild( tmp.firstChild ); - } - - // Remember the top-level container for proper cleanup - tmp = safe.lastChild; - } - } - } - - // Fix #11356: Clear elements from fragment - if ( tmp ) { - safe.removeChild( tmp ); - } - - // Reset defaultChecked for any radios and checkboxes - // about to be appended to the DOM in IE 6/7 (#8060) - if ( !support.appendChecked ) { - jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); - } - - i = 0; - while ( (elem = nodes[ i++ ]) ) { - - // #4087 - If origin and destination elements are the same, and this is - // that element, do not do anything - if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( safe.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( (elem = tmp[ j++ ]) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - tmp = null; - - return safe; - }, - - cleanData: function( elems, /* internal */ acceptData ) { - var elem, type, id, data, - i = 0, - internalKey = jQuery.expando, - cache = jQuery.cache, - deleteExpando = support.deleteExpando, - special = jQuery.event.special; - - for ( ; (elem = elems[i]) != null; i++ ) { - if ( acceptData || jQuery.acceptData( elem ) ) { - - id = elem[ internalKey ]; - data = id && cache[ id ]; - - if ( data ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Remove cache only if it was not already removed by jQuery.event.remove - if ( cache[ id ] ) { - - delete cache[ id ]; - - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( deleteExpando ) { - delete elem[ internalKey ]; - - } else if ( typeof elem.removeAttribute !== strundefined ) { - elem.removeAttribute( internalKey ); - - } else { - elem[ internalKey ] = null; - } - - deletedIds.push( id ); - } - } - } - } - } -}); - -jQuery.fn.extend({ - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); - }, null, value, arguments.length ); - }, - - append: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - }); - }, - - prepend: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - }); - }, - - before: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - }); - }, - - after: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - }); - }, - - remove: function( selector, keepData /* Internal Use Only */ ) { - var elem, - elems = selector ? jQuery.filter( selector, this ) : this, - i = 0; - - for ( ; (elem = elems[i]) != null; i++ ) { - - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem ) ); - } - - if ( elem.parentNode ) { - if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { - setGlobalEval( getAll( elem, "script" ) ); - } - elem.parentNode.removeChild( elem ); - } - } - - return this; - }, - - empty: function() { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - } - - // Remove any remaining nodes - while ( elem.firstChild ) { - elem.removeChild( elem.firstChild ); - } - - // If this is a select, ensure that it displays empty (#12336) - // Support: IE<9 - if ( elem.options && jQuery.nodeName( elem, "select" ) ) { - elem.options.length = 0; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map(function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined ) { - return elem.nodeType === 1 ? - elem.innerHTML.replace( rinlinejQuery, "" ) : - undefined; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - ( support.htmlSerialize || !rnoshimcache.test( value ) ) && - ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && - !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) { - - value = value.replace( rxhtmlTag, "<$1>" ); - - try { - for (; i < l; i++ ) { - // Remove element nodes and prevent memory leaks - elem = this[i] || {}; - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch(e) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var arg = arguments[ 0 ]; - - // Make the changes, replacing each context element with the new content - this.domManip( arguments, function( elem ) { - arg = this.parentNode; - - jQuery.cleanData( getAll( this ) ); - - if ( arg ) { - arg.replaceChild( elem, this ); - } - }); - - // Force removal if there was no new content (e.g., from empty arguments) - return arg && (arg.length || arg.nodeType) ? this : this.remove(); - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, callback ) { - - // Flatten any nested arrays - args = concat.apply( [], args ); - - var first, node, hasScripts, - scripts, doc, fragment, - i = 0, - l = this.length, - set = this, - iNoClone = l - 1, - value = args[0], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return this.each(function( index ) { - var self = set.eq( index ); - if ( isFunction ) { - args[0] = value.call( this, index, self.html() ); - } - self.domManip( args, callback ); - }); - } - - if ( l ) { - fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - if ( first ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( this[i], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { - - if ( node.src ) { - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl ) { - jQuery._evalUrl( node.src ); - } - } else { - jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); - } - } - } - } - - // Fix #11809: Avoid leaking memory - fragment = first = null; - } - } - - return this; - } -}); - -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - i = 0, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone(true); - jQuery( insert[i] )[ original ]( elems ); - - // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -}); - - -var iframe, - elemdisplay = {}; - -/** - * Retrieve the actual display of a element - * @param {String} name nodeName of the element - * @param {Object} doc Document object - */ -// Called only from within defaultDisplay -function actualDisplay( name, doc ) { - var style, - elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), - - // getDefaultComputedStyle might be reliably used only on attached element - display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? - - // Use of this method is a temporary fix (more like optmization) until something better comes along, - // since it was removed from specification and supported only in FF - style.display : jQuery.css( elem[ 0 ], "display" ); - - // We don't have any data stored on the element, - // so use "detach" method as fast way to get rid of the element - elem.detach(); - - return display; -} - -/** - * Try to determine the default display value of an element - * @param {String} nodeName - */ -function defaultDisplay( nodeName ) { - var doc = document, - display = elemdisplay[ nodeName ]; - - if ( !display ) { - display = actualDisplay( nodeName, doc ); - - // If the simple way fails, read from inside an iframe - if ( display === "none" || !display ) { - - // Use the already-created iframe if possible - iframe = (iframe || jQuery( "