Pyfancy-2 icon indicating copy to clipboard operation
Pyfancy-2 copied to clipboard

Pyfancy v3

Open CosmicWebServices opened this issue 8 years ago • 43 comments

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

CosmicWebServices avatar Jan 15 '18 17:01 CosmicWebServices

If it's meant to be supported on as many platforms as possible, we should probably look into using curses.

TheMonsterFromTheDeep avatar Feb 12 '18 19:02 TheMonsterFromTheDeep

@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 avatar Feb 12 '18 20:02 CosmicWebServices

@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.

TheMonsterFromTheDeep avatar Feb 16 '18 21:02 TheMonsterFromTheDeep

Ooh, interesting stuff! I might look into some of the scrolling bars and such over the weekend

joker314 avatar Feb 16 '18 21:02 joker314

@TheMonsterFromTheDeep @joker314 Yay! Cool... I need to set aside time to really start working on this again. Any other ideas for additions?

CosmicWebServices avatar Feb 16 '18 21:02 CosmicWebServices

@TheMonsterFromTheDeep There are plenty of Markdown parses in python but unfortunately they output as HTML... well at least he ones I have found.

CosmicWebServices avatar Feb 16 '18 21:02 CosmicWebServices

Ah, we need something to parse but not convert

joker314 avatar Feb 16 '18 21:02 joker314

Also I made a v2 branch... unless we want to do what we did before and make a fork

CosmicWebServices avatar Feb 16 '18 21:02 CosmicWebServices

I am still researching how to parse markdown with python. We could make our own solution if it is better that way

CosmicWebServices avatar Feb 16 '18 21:02 CosmicWebServices

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 avatar Feb 16 '18 22:02 joker314

@joker314 Yeah I can do that and yes that was pretty unfair...

CosmicWebServices avatar Feb 16 '18 22:02 CosmicWebServices

@joker314 Fixed #56

CosmicWebServices avatar Feb 16 '18 22:02 CosmicWebServices

Also I think I should update the v2 branch because it is a little behind...

CosmicWebServices avatar Feb 16 '18 22:02 CosmicWebServices

@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…

jeandrek avatar Feb 16 '18 22:02 jeandrek

It looks like it would be possible to use https://github.com/lepture/mistune for markdown parsing.

TheMonsterFromTheDeep avatar Feb 16 '18 22:02 TheMonsterFromTheDeep

@TheMonsterFromTheDeep Which bit of it makes you say that?

joker314 avatar Feb 16 '18 22:02 joker314

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.

TheMonsterFromTheDeep avatar Feb 16 '18 22:02 TheMonsterFromTheDeep

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.)

jeandrek avatar Feb 16 '18 22:02 jeandrek

@Jonathan50 Cool :D is there any syntax changes we should make? Or does the chaining work for now?

CosmicWebServices avatar Feb 17 '18 00:02 CosmicWebServices

@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.

TheMonsterFromTheDeep avatar Feb 17 '18 04:02 TheMonsterFromTheDeep

Pyfancy 3 thumbnail/logo made with carbon

carbon 2

CosmicWebServices avatar Feb 17 '18 12:02 CosmicWebServices

soooo....

CosmicWebServices avatar Feb 24 '18 19:02 CosmicWebServices

What should I being doing first that would be helpful?

CosmicWebServices avatar Mar 03 '18 16:03 CosmicWebServices

@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 avatar Mar 08 '18 22:03 CosmicWebServices

@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 avatar Mar 09 '18 04:03 TheMonsterFromTheDeep

@TheMonsterFromTheDeep Gotcha okay so maybe we should start designing what the library looks like now

CosmicWebServices avatar Mar 09 '18 17:03 CosmicWebServices

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 avatar May 01 '18 14:05 CosmicWebServices

@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.

TheMonsterFromTheDeep avatar May 01 '18 16:05 TheMonsterFromTheDeep

https://docs.python.org/2/extending/extending.html

CosmicWebServices avatar May 01 '18 16:05 CosmicWebServices

Working on an update using this package https://github.com/peterbrittain/asciimatics

CosmicWebServices avatar Aug 21 '18 19:08 CosmicWebServices