Git Product home page Git Product logo

textual-dev's Introduction

textual-dev

Development tools for Textual.

checks

This package contains the textual command line app, which will help to develop Textual applications.

See Getting Started for how to use it.

textual-dev's People

Contributors

csernazs avatar darrenburns avatar davep avatar davetapley avatar pratik-m avatar rodrigogiraoserrao avatar vlaci avatar willmcgugan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

textual-dev's Issues

Add a --host switch to `textual run` command

We need to had a --host switch to the textual run command which will connect to the given host. At the moment, this defaults to 127.0.0.1, but the switch would allow the console to run on another machine.

Textual (in main) has a TEXTUAL_DEVTOOLS_HOST env var which defaults to 127.0.0.1, textual_dev should populate this env var in the textual run command.

Is there a simpler way to debug textual apps?

I'm using an environment where I cannot really run multiple instances of the terminal, so using textual console to debug the textual apps is not feasible. I tried many tricks, but nothing works.
Is there a simpler way to debug textual apps?
I just need to save a detailed app.log file on disc and check it to find what went wrong. Since the issue is that we cannot write debug text on screen because it would broke the visual formatting, just redirecting all logging and errors output to a file log would be enough. Of course this log file would need to be ANSI formatted, and would require a textual powered reader to read it.
The local() method is great to print the local variables state at every log() or print() command, but its output should be integrated in a nicely ANSI formatted log file saved to disc. Or even better, textual-dev could include a reader app for ansi-encoded files, like the syntax aware codebrowser example app, so you can read a log with the full rich content generated by TextualHandler and RichHandler.
Is saving a rich log file possible? It would help to debug textual apps a lot for people like me. What do you think?

Possibility of adding tags

Hi,

Firstly I want to say that I've been greatly enjoying trying out textual!

I am attempting to package textual-dev for Nix: see PR here. As part of the review process for packaging Nix it came up that tags are missing for textual-dev. Is this something which would be possible to add? Happy to help out with this if I can :)

Drop support for Python 3.7

It's EOL; no reason to support a zombie.
Additionally, we could drop dependency on typing_extensions as soon as we drop support for Python 3.7.

Update `textual --version` to report its own version number

If you run textual --version you get the version of Textual that's installed and used by textual-dev. That's fine, almost all of the time.

But there are times where you want to know the version of textual-dev too.

Modify --version so that it reports both the version of textual and textual-dev.

Add support for detecting `rio` in `textual diagnose`

It looks like rio doesn't currently advertise itself via TERM_PROGRAM or via any other obvious environment variable. The result is it comes out as *Unknown*.

It looks like XPC_SERVICE_NAME is always set (on macOS anyway) to something that starts with application.com.raphaelamorim.rio so this can work as a fallback detection method.

Nesting CSS does not work with textual-dev

Hello everyone,
I have been recently using the textual-dev cli and I have been facing an extremely peculiar issue.
Whenever I try nesting CSS using the & it fails horibbly.

Minimum Reproducible Example:

issue.py

from textual.app import App
from textual.widgets import Static

class BasicWidget(Static):
    def compose(self):
        yield Static("Inside", classes="inside")


class BasicApp(App):
    CSS_PATH = "issue.tcss"
    def compose(self):
        yield BasicWidget()
    

if __name__ == '__main__':
    app = BasicApp()
    app.run()

issue.tcss

BasicWidget {
    background: red;
    width: 40;

    & .inside {
        background: green;
        width: 10;
    }
}

———————————————————————————————————————————————————————————
Commands Tested:
python issue.py -> Works normally
textual run issue.py --dev -> The following error in stylesheet:

 • Expected one of 'comment line', 'comment start', 'declaration name', 'declaration set end', or 'whitespace'.
 • Did you forget a semicolon at the end of a line?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.