question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with adding cards

See original GitHub issue

I finally found some time to try creating cards with apy.

When I try to type apy add into the terminal, my editor opens with:

model: Basic
tags: marked

# Note

## Front

## Back
**CATEGORY**

## Hint

I change it to:

model: Basic
tags: marked

# Note

## Front
What is this?
## Back
This is a test!

## Hint
test

When I exit my editor, the following error occurs:

Database was modified.
Remember to sync!
Traceback (most recent call last):
  File "/home/skervim/anaconda3/envs/rl/bin/apy", line 11, in <module>
    load_entry_point('apy', 'console_scripts', 'apy')()
  File "/home/skervim/anaconda3/envs/rl/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/skervim/anaconda3/envs/rl/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/skervim/anaconda3/envs/rl/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/skervim/anaconda3/envs/rl/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/skervim/anaconda3/envs/rl/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/skervim/apy/apy/cli.py", line 58, in add
    notes = a.add_notes_with_editor(tags, model)
  File "/home/skervim/apy/apy/anki.py", line 291, in add_notes_with_editor
    return self.add_notes_from_file(tf.name)
  File "/home/skervim/apy/apy/anki.py", line 297, in add_notes_from_file
    tags)
  File "/home/skervim/apy/apy/anki.py", line 324, in add_notes_from_list
    note['markdown']))
  File "/home/skervim/apy/apy/anki.py", line 354, in _add_note
    return Note(self, note)
  File "/home/skervim/apy/apy/note.py", line 11, in __init__
    self.fields = [x for x, y in self.n.items()]
  File "/home/skervim/anki/anki/notes.py", line 89, in items
    for ord, f in sorted(self._fmap.values())]
  File "/home/skervim/anki/anki/notes.py", line 89, in <listcomp>
    for ord, f in sorted(self._fmap.values())]
IndexError: list index out of range

Any idea what I am doing wrong?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lervagcommented, Oct 30, 2019

Thanks for pointing out :cquit. Nice to learn something new! It’s really time for me to work through vim’s user manual once and for all 😄 .

No problem. I’m actually working with the user manual myself (even though I’ve used Vim for 16-17 years already), and I find it very interesting to see that there are still things I’ve missed!

With the addition to the documentation, I think this issue can be closed.

Great! I’ll close when I’ve updated the usage section according to your later comment.

When I have a bit more time on my hands I will look at the code and its documentation and see whether I can give some feedback about whether some documentation is missing.

Thanks! That will be very much appreciated!

EDIT: Probably it would be a good idea to extend the usage section in the documentation,

apy --help

with some information about how to get information about the sub-commands, e.g.

apy add --help

At least I didn’t get from the apy --help section that I would be able to give tags and model as options to the apy add command (which is by the way super awesome 😃 )

Good point. And thanks! 😃

0reactions
skervimcommented, Oct 30, 2019

Thanks for pointing out :cquit. Nice to learn something new! It’s really time for me to work through vim’s user manual once and for all 😄 . With the addition to the documentation, I think this issue can be closed.

When I have a bit more time on my hands I will look at the code and its documentation and see whether I can give some feedback about whether some documentation is missing.

EDIT: Probably it would be a good idea to extend the usage section in the documentation,

apy --help

with some information about how to get information about the sub-commands, e.g.

apy add --help

At least I didn’t get from the apy --help section that I would be able to give tags and model as options to the apy add command (which is by the way super awesome 😃 )

Read more comments on GitHub >

github_iconTop Results From Across the Web

If you can't add a card to Apple Wallet to use with Apple Pay
Learn what steps to take if you can't add a card to the Wallet app to use with Apple Pay. Check that you're...
Read more >
How to Fix Apple Pay Error Adding Card - AppleToolBox
Another reason why you're getting an error message when adding your card to Apple Pay is that your device is set to the...
Read more >
Can't Add a Card to Apple Pay? 8 Ways to Fix
Can't Add a Card to Apple Pay? 8 Ways to Fix · 1. Troubleshoot Internet Connection · 2. Delete Some Cards · 3....
Read more >
“Could not add card” error message when adding a bank card
If a player received an error messages when adding their card saying: “Card not Added. Your card does not support this type of...
Read more >
There was an error adding the credit or debit card. Make sure ...
There are a few reasons why one might get this error. The most common reason is that the information added is not matching...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found