Commit Graph

10 Commits

Author SHA1 Message Date
Joel Kitching
975ca90225 don't rely on cwd in media.py
media.py sets CWD to the media directory of the collection
(collection.media), and relies on that directory being
maintained as CWD throughout execution.  The original CWD
is restored in the close() function.

Remove reliance on CWD being set and maintained throughout
execution of media.py.  Improves portability and usability
in different codebases.
2017-03-07 15:55:40 +08:00
Damien Elmes
15b349e3a8 start port to python 3
unit tests pass and main screens of GUI load
2016-05-12 14:45:35 +10:00
Damien Elmes
354fbd33f6 fix media test 2014-07-28 14:26:40 +09:00
dae
09253b661c getEmptyDeck() -> getEmptyCol() 2014-06-03 17:38:47 +09:00
Damien Elmes
99d82c1f2d fix hasIllegal check, and associated unit test 2013-11-26 03:19:11 +09:00
Damien Elmes
0d1d8c5bf9 define standard encoding for unicode (#893)
- always store media references in fields in NFC form
- always encode filenames on disk in NFC form on machines other than macs
- use relevant encoding when placing files in the media folder during syncs
  and apkg imports as well
- rename 'unused media' back to 'check media'
- check media can now automatically change media references and filename
  encodings to the correct format
2013-09-20 19:28:44 +09:00
Damien Elmes
a538e29480 refactor illegal char handling and file adding for media
- add writeData() so we can add files to media folder without having to
  save them in an intermediate folder first
- we were stripping or checking for illegal filename characters in
  multiple places; factor those checks out into separate routines
- add * to invalid char list, and disallow both forward and backslash
- remove size checks in syncAdd(); is handled server-side
2013-07-11 15:33:24 +09:00
Damien Elmes
918694a096 more media regexp fixes
- split quoted and unquoted image case into separate regexps, since we can't
  include a group reference inside a character set
- disallow spaces in the non-quoted case
- this should fix matching on images with other attributes again
2013-05-22 09:45:58 +09:00
Damien Elmes
b2457811a2 optimize imports 2012-12-22 09:17:10 +09:00
Damien Elmes
d477df8c28 merged libanki and ankiqt into single distro 2012-12-21 16:51:59 +09:00