Examples seem to be out of date
See original GitHub issueHi, I am trying to use examples in the documentation, but many of them seem to be out of date. For example:
from prompt_toolkit.shortcuts import prompt
from prompt_toolkit.styles import Style
style = Style.from_dict({
# User input.
'': '#ff0066',
# Prompt.
'username': '#884444',
'at': '#00aa00',
'colon': '#00aa00',
'pound': '#00aa00',
'host': '#000088 bg:#aaaaff',
'path': '#884444 underline',
})
def get_prompt():
return [
('class:username', 'john'),
('class:at', '@'),
('class:host', 'localhost'),
('class:colon', ':'),
('class:path', '/user/john'),
('class:pound', '# '),
]
text = prompt(get_prompt, style=style)
causes exception: “AttributeError: type object ‘Style’ has no attribute ‘from_dict’”. I had issues with most of the examples I tried so far, but had satisfaction following this article: 4 Python libraries for building great command-line user interfaces.
Am I missing something? Is it maybe because examples are not updated to version 2?
Best Regards
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Use out-of-date in a sentence
Example sentences with the word out-of-date. The most voted sentence example for out-of-date is The success of the restaurant ...
Read more >Out of date in a sentence
60+3 sentence examples: 1. A passport that is out of date is invalid. 2. But it's out of date already. 3. That radio...
Read more >Use out of date in a sentence - Bab.la
How to use "out of date" in a sentence? ; Finally, this report is · of date. ; But they are now ·...
Read more >100 Synonyms & Antonyms of OUT-OF-DATE - Merriam-Webster
Synonyms for OUT-OF-DATE: obsolete, antiquated, archaic, outdated, medieval, dated, outmoded, prehistoric; Antonyms of OUT-OF-DATE: modern, current, new, ...
Read more >25 English Expressions You Might Encounter (But Which Now ...
25 English Expressions You Might Encounter (But Which Now Seem Out Of Date) · 1. Cut to the chase · 2. Whoops-a-daisy ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Maybe it would be best to mention this in the README. For example, explaining that, to try the latest examples before the release of version 2.0, one can use this command to install the package:
Instead of:
agree @RobertoPrevato
I encounter the same issue.