Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show component attributes #58

Open
meatballs opened this issue Feb 10, 2022 · 2 comments
Open

Show component attributes #58

meatballs opened this issue Feb 10, 2022 · 2 comments
Labels
enhancement request New feature or request

Comments

@meatballs
Copy link
Contributor

Any chance of having the attributes of each class in https://github.com/anvil-works/anvil-runtime/blob/master/downlink/python/anvil/_components.py (or a corresponding .pyi file)?

When working offline, this would enable auto-completers to offer more than just the __init__ parameters for a component.

@meatballs
Copy link
Contributor Author

More in hope than expectation, I tried running stubgen but just got:

from . import _server, server as server

class Component(_server.SerializeWithIdentity):
    def __init__(self, __ignore_property_exceptions: bool = ..., **props) -> None: ...
    def __deserialize__(self, data, global_data) -> None: ...
    def __serialize_once__(self, global_data): ...

class Container(Component):
    def __init__(self, __ignore_property_exceptions: bool = ..., **props) -> None: ...
    def add_component(self, c, **lp) -> None: ...

class ComponentTag: ...
class Button(Component): ...
class Canvas(Component): ...
class CheckBox(Component): ...
class ColumnPanel(Container): ...
class DataGrid(Container): ...
class DataRowPanel(Container): ...
class DatePicker(Component): ...
class DropDown(Component): ...
class FileLoader(Component): ...
class FlowPanel(Container): ...
class GoogleMap(Container): ...
class GridPanel(Container): ...
class HtmlTemplate(Container): ...
class Image(Component): ...
class Label(Component): ...
class LinearPanel(Container): ...
class Link(Container): ...
class Plot(Component): ...
class RadioButton(Component): ...
class RepeatingPanel(Component): ...
class RichText(Container): ...
class Spacer(Component): ...
class TextArea(Component): ...
class TextBox(Component): ...
class Timer(Component): ...
class XYPanel(Container): ...
class YouTubeVideo(Component): ...

which didn't really add anything new!

@meatballs
Copy link
Contributor Author

If the only realistic wayto do this is to create a pyi file manually, I'll put a PR together.

But, given that the file says it's autogenerated, I wondered if there's some way to automate this.

@meredydd meredydd added the enhancement request New feature or request label May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants