Pyfancy v3
I want to start thinking about creating the next version of Pyfancy. Just some things I want to do. Instead of just styling the terminal I now want Pyfancy to work for all things terminal such as progress bars, menus and better inputs. I also want it to be cross-compatible and light weight.
- [ ] Better formatting based on bbcode or markdown.
- [ ] Progress bars
- [ ] Menu select
- [ ] Long console prints with "scroll bars"
- [ ] Plugins?
Also some non-coding things:
- [ ] Better website
- [x] Pip (finally)
- [ ] Better review system
- [ ] Cleaner file system
If it's meant to be supported on as many platforms as possible, we should probably look into using curses.
@TheMonsterFromTheDeep Hello again! Yes, that was one of the options I was looking at. Have not had tons of time to work on Pyfancy unforchanatly.
@CosmicWebServices I might, just for fun, look into some possibilities this weekend. I imagine that there are also libraries for parsing Markdown/BBCode out there.
Ooh, interesting stuff! I might look into some of the scrolling bars and such over the weekend
@TheMonsterFromTheDeep @joker314 Yay! Cool... I need to set aside time to really start working on this again. Any other ideas for additions?
@TheMonsterFromTheDeep There are plenty of Markdown parses in python but unfortunately they output as HTML... well at least he ones I have found.
Ah, we need something to parse but not convert
Also I made a v2 branch... unless we want to do what we did before and make a fork
I am still researching how to parse markdown with python. We could make our own solution if it is better that way
I found that making a fork was really unfair on us because we contributed loads of code and barely showed up in the statistics. :(
I think branches are good 👍
(Ooh, could you make a note in the README not to trust the data in the GitHub stats)
@joker314 Yeah I can do that and yes that was pretty unfair...
@joker314 Fixed #56
Also I think I should update the v2 branch because it is a little behind...
@joker314 I don't think anybody would really mind, but it's fine.
Edit: Sorry about the double post, my computer powered off and when I started Firefox again it didn't show my message so I assumed I hadn't posted it yet…
It looks like it would be possible to use https://github.com/lepture/mistune for markdown parsing.
@TheMonsterFromTheDeep Which bit of it makes you say that?
It lets you plug in a custom renderer class, which simply defines methods for each markdown construct.
It might be a little kludgy when combined with curses, because it is supposed to return a value while here it would be printing a value, but it would probably work.
Also, the 32 colour codes can be trivially generated from the 8 basic colours (add 30 for foreground colour, 40 for background, 90 for bright foreground, and 100 for bright background).
Could be something like this:
colors = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'grey']
for (c, name) in enumerate(colors):
codes[name] = c+30
codes[name+'_bg'] = c+40
codes['light_'+name] = c+90
codes['light_'+name+'_bg']
(This code won't work with the names of the blacks/greys/whites though.)
@Jonathan50 Cool :D is there any syntax changes we should make? Or does the chaining work for now?
@Jonathan50: the question, of course, is whether we do want to migrate to curses, at which point those codes will not be used at all.
soooo....
What should I being doing first that would be helpful?
@TheMonsterFromTheDeep Just researched curses and it is not very cross compatible... Does not work well with windows so you need to download a port
@CosmicWebServices it's strange that the Python version of curses is that way. It's relatively straightforward to build a Windows application with curses in C simply by using MinGW.
However, there's another reason curses doesn't exactly work: although it gives you control over the whole screen, it doesn't really provide a way to simply color your output. That is, if you were designing a tool such as ls, which merely prints output to your console but doesn't actually run an entire command-line user interface, it wouldn't really be possible to use curses.
So I think curses might not be quite the best option.
@TheMonsterFromTheDeep Gotcha okay so maybe we should start designing what the library looks like now
I am going to start working on lots of open source projects this summer including this one...
So basically just some questions relating to this project.
Keep the syntax? How should/can the interactive elements (menus, progress bars, etc) work? New name? To curses or not to curses? etc.
@CosmicWebServices if there's some way to call C api's from Python, it would be pretty easy to get this to work on Windows using the Windows console API.
Curses is, I think, inappropriate for the reasons discussed previously.
https://docs.python.org/2/extending/extending.html
Working on an update using this package https://github.com/peterbrittain/asciimatics
