Hi, I'm afraid that if you manually edit cards files without being careful, all bets are off, and you will indeed run into all sorts of weird problems. Unfortunately, I will not be able to give support for that case, so I do indeed suggest restoring from a backup.
If in that case you still get errors, by all means, do get back in touch! The minor issues you mention at the end of the mail seem all related to the Qt toolkit we use, and not directly under our control. I'll have a look if I can work around them, but in all likelihood they are toolkit bugs. Cheers, Peter On Saturday, 18 March 2017 18:28:43 UTC+1, [email protected] wrote: > > (Excuse the random name and email.) > > Hi, > > I've suddenly run into a number of errors and problems with Mnemosyne > (2.4.1, installed on Windows 10). I'd be happy to make proper bug reports > over on Launchpad if they'd be useful but it feels like something deeper > has gone wrong and it's time to restore a backup and try again. > > Quick summary: Made some images and tab-delimited list for some map cards, > tried to import them incorrectly, eventually figured it out but some cards > disappeared during card-type conversion; now have reproducible errors in > the (de)activate cards window, when converting the type of certain cards, > when setting the field mapping for certain card type conversions, and if I > try to create a Map card with the Location set to 'Alabama' or 'Alaska'. > > Okay, in somewhat more detail, and with the apology that I didn't realise > it was going to get so complicated and didn't document much of it: > > Wanting to make a bunch of map cards, and finding Timothy Bourke's > svgtoquiz unsuitable for my needs, I created some map cards in the program > and exported them in various formats as a starting point for importing some > of my own (with various attempts including manually editing the cards.xml > file inside a .cards file). Importing these didn't work, unsurprisingly - > with the exception that a .cards import might have technically succeeded > once without seeming to add any cards (!). The manual text file (with two > columns, not three) got imported fine too, but when I tried to convert the > "front-to-back only" card type to a Map, I got an error in the > field-mapping dialog. > > In this case the dialog has two combo boxes (front and back) and three > options in each (location, blank map, marked map). As soon as I picked > something for both combo boxes (I don't recall if it had to be something > specific) I got the following error: > --------------------------- > An unexpected error has occurred. > Please forward the following info to the developers: > > Traceback (innermost last): > File "mnemosyne\pyqt_ui\convert_card_type_keys_dlg.py", line 74, in > combobox_updated > TypeError: critical(QWidget, str, str, buttons: > Union[QMessageBox.StandardButtons, QMessageBox.StandardButton] = > QMessageBox.Ok, defaultButton: QMessageBox.StandardButton = > QMessageBox.NoButton): argument 4 has unexpected type 'str' > --------------------------- > The dialog otherwise worked and I could repeat the process continually, > but the OK button was never enabled so I couldn't progress/do any harm. > > I eventually found information on this forum explaining how to import map > cards as three columns in a tab-delimited file and tried that, successfully > importing them as vocabulary cards. When I tried to convert them, however, > I selected all the cards at once (50 pairs of 2 sister cards in this case, > a test run with US states) and set the mapping appropriately, and got the > following error: > --------------------------- > An unexpected error has occurred. > Please forward the following info to the developers: > > Traceback (innermost last): > File "mnemosyne\pyqt_ui\browse_cards_dlg.py", line 633, in > menu_change_card_type > File "mnemosyne\libmnemosyne\controllers\default_controller.py", line > 409, in change_card_type > File "mnemosyne\libmnemosyne\controllers\default_controller.py", line > 287, in _change_card_type > File "mnemosyne\libmnemosyne\controllers\default_controller.py", line > 117, in create_new_cards > File "mnemosyne\libmnemosyne\databases\SQLite.py", line 1346, in > duplicates_for_fact > TypeError: 'NoneType' object is not subscriptable > --------------------------- > I escaped out of the card browser and went back in and tried with smaller > batches, and the error appeared maybe once or twice more but mostly it > worked. At the end I noticed I was two states short - Alabama and Alaska, > the first two alphabetically, but no different in format to the rest. On > one hand, having otherwise valid cards get irreversibly and almost-silently > deleted is a pretty big bug, but I already contaminated things since I'm > pretty sure I used Alabama and Alaska in the manual attempts at the very > beginning. > > Figuring it was easier to add them manually, I used the add-card dialog > and got/get the following error if the Location field matched one of their > names: > --------------------------- > An unexpected error has occurred. > Please forward the following info to the developers: > > Traceback (innermost last): > File "mnemosyne\pyqt_ui\add_cards_dlg.py", line 259, in create_new_cards > File "mnemosyne\libmnemosyne\controllers\default_controller.py", line > 117, in create_new_cards > File "mnemosyne\libmnemosyne\databases\SQLite.py", line 1346, in > duplicates_for_fact > TypeError: 'NoneType' object is not subscriptable > --------------------------- > However, if I change the Location field (e.g. "Blabama") and then edit it > back to "Alabama" in the card browser, there's no error. Compacting the > database doesn't appear to have any effect. > > Finally - and I'm pretty sure but not certain this was happening before > today - while I was doing this I had my cards filtered in the (de)activate > cards dialog to make the card browser less cluttered. I've found that the > option to filter cards "not having any of these tags" is inaccessible - > attempting to use it and checking one or more tags creates the following > error when I click OK: > --------------------------- > Mnemosyne > --------------------------- > An unexpected error has occurred. > Please forward the following info to the developers: > > Traceback (innermost last): > File "mnemosyne\pyqt_ui\activate_cards_dlg.py", line 224, in accept > File "mnemosyne\pyqt_ui\criterion_wdgt_default.py", line 76, in > criterion > File "mnemosyne\pyqt_ui\tag_tree_wdgt.py", line 274, in > checked_to_forbidden_tags_in_criterion > AttributeError: 'list' object has no attribute 'values' > --------------------------- > > Oh, one more late addition - while writing this, I wondered if the 'find > duplicates' menu option might discover the missing cards (having never > tried it before), and the initial messagebox helpfully explains it has a > specific other purpose, but was followed by a now somewhat familiar error: > --------------------------- > An unexpected error has occurred. > Please forward the following info to the developers: > > Traceback (innermost last): > File "mnemosyne\pyqt_ui\main_wdgt.py", line 225, in find_duplicates > File "mnemosyne\libmnemosyne\controllers\default_controller.py", line > 809, in find_duplicates > File "mnemosyne\libmnemosyne\databases\SQLite.py", line 1371, in > tag_all_duplicates > TypeError: 'NoneType' object is not subscriptable > --------------------------- > > I guess the actual bug is somewhere in the import process, due to it not > expecting a crazy person to mess around with the internals of a .cards > file, and all the NoneType errors stem from that. I can't see a way to > attach files from this interface but I still have what I think is the > offending .cards file in question if you want to bother making it literally > more foolproof. > > > > I've also noticed some other things that don't seem to have been mentioned > recently, and were happening before I started all this map-card importing. > Are any of these unknown potentially-worthwhile bugs? > * Sometimes some of the numbered buttons will appear to be active before > I show the answer (i.e. they're not disabled). I haven't tried to click one > to see if something happens or if it's just cosmetic. The last time it > happened it was buttons 2 and 4 only. Not consistently reproducible. > * Dialogs will sometimes appear on my second monitor instead of the same > monitor as the main window. Not consistently reproducible. > * The font dialog doesn't remember its settings, and goes back to the > default font, size, etc. every time I open it (in this case, MS Shell Dlg > 2, Normal, size 8). The font itself is saved as long as I don't open the > dialog and click OK (in which case it obviously 'resets'). > * Possibly a Windows or Python-on-Windows thing - if I open the 'Add > cards' window and then minimise it, clicking on the main window doesn't > bring it back to the front and all the controls are inaccessible, making > the program appear to be frozen. While that one's fairly obvious, the same > thing happens if the Add cards window is elsewhere behind another program's > window - controls on the main window are unreachable (as expected for a > program with a modal dialog open) but neither of them appears to get focus > or come to the front when the main window is clicked. > * Minor, but emojis display differently in the preview window compared to > the main screen. I suppose it's just using a different font or font > settings? (I noticed when putting some in for phases of the moon; they > displayed only as squares in the past so it's a lot less of an issue now > anyway.) -- You received this message because you are subscribed to the Google Groups "mnemosyne-proj-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mnemosyne-proj-users/8d5c5bde-d50d-40e0-8c8b-2470c5bf2405%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
