Search code examples
linuxpython-3.xdesign-patternsncursescurses

Python curses interface


I have developed a program using curses, everything is cool so far but I was wondering myself if there is a good pattern to split different views/panels of my program into smaller chunks callable by my main loop?

Further informations:

This program is a rather small automation tool/wizard aiming to ease our application for customers requiring the on-premise installation.

This wizard is a 3 steps one and it’s used to grab informations from our customer installation needs depending of it’s chosen architecture.

The first step is requesting the customer to give us its identification informations such has contract number, company name, licence number and preferred contact.

The second step is requesting the customer to give us informations about either he want a standalone installation (All-In-One install) or a N-Tiers installation plus the required informations like the requested custom SSL VHostName or Tiers IP/Credentials.

The third and final step is showing the customer a progress bar and informations of the required services (MySQL/HTTPd/HAProxy/PHP-FPM) and our application.

I know that I do not especially need to use curses library for such a program but our UX Team requested it as it is part of our customer experience with the solution.


Solution

  • as such way to do things is not really usual, do not expect any framework to be available (like those available for WebUI for instance).

    I so decided to create my own "Framework/factory" and so to be able to split every aspect of my app in a logic that would be similar of those used by web applications.

    The source-code is dirty and really not pythonic, but it is well working so far and quite easy to maintain.

    Thanks everyone for your answers and ideas.