do we really want to keep from .justpy import * #486
Replies: 4 comments 1 reply
-
This is what FastAPI does: https://github.com/tiangolo/fastapi/blob/master/fastapi/__init__.py We could certainly be more specific about the names that should be globaI. The advantage of the line is that the user of justpy does not need to have many lines of imports in the program and makes the programs more simple and easier to learn. Also, because editor completion, it lets users discover new components and features without having to explicitly import them. |
Beta Was this translation helpful? Give feedback.
-
@elimintz. For compatibility we will have to keep a bit of the jp default namespace. I just fear that new modules will need a new namespace such as jp2 see #498 and that there should be an alternative advanced init procedure that will allow for proper testing, multiple apps and other advanced usecases where namespace and status separation of concerns is a must. Its also kind of a hen and egg problem since to test the lot of the tutorial examples we need an improved namespace situation but we'd have to modify all tutorials first if we are to strict in the refactoring. |
Beta Was this translation helpful? Give feedback.
-
Currently the build fails due to an unsuccessful refactorization of the test and startup code see e.g. demostarter. I hope to get this fixed soon. |
Beta Was this translation helpful? Give feedback.
-
461 names found ['A',
'AGGRID',
'AGGRID_ENTERPRISE',
'Abbr',
'Address',
'AgGrid',
'AltairChart',
'Animate',
'AnimateMotion',
'AnimateTransform',
'Area',
'Article',
'Aside',
'Audio',
'AutoTable',
'B',
'BOKEH',
'BasicHTMLParser',
'Bdi',
'Bdo',
'BeautifulSoup',
'Blockquote',
'BokehChart',
'Br',
'Button',
'COOKIE_MAX_AGE',
'CRASH',
'Caption',
'Circle',
'Cite',
'ClipPath',
'Code',
'Col',
'Colgroup',
'Config',
'DEBUG',
'DECKGL',
'Data',
'Dd',
'DefaultSimpleDict',
'Defs',
'Del',
'Desc',
'Details',
'Dfn',
'Dict',
'Discard',
'Div',
'Dl',
'Dt',
'EditorMD',
'Ellipse',
'Em',
'Embed',
'Equation',
'FAVICON',
'FeBlend',
'FeColorMatrix',
'FeComponentTransfer',
'FeComposite',
'FeConvolveMatrix',
'FeDiffuseLighting',
'FeDisplacementMap',
'FeDistantLight',
'FeDropShadow',
'FeFlood',
'FeFuncA',
'FeFuncB',
'FeFuncG',
'FeFuncR',
'FeGaussianBlur',
'FeImage',
'FeMerge',
'FeMergeNode',
'FeMorphology',
'FeOffset',
'FePointLight',
'FeSpecularLighting',
'FeSpotLight',
'FeTile',
'FeTurbulence',
'Fieldset',
'Figcaption',
'Figure',
'Filter',
'Footer',
'ForeignObject',
'Form',
'G',
'GZipMiddleware',
'H1',
'H2',
'H3',
'H4',
'H5',
'H6',
'HIGHCHARTS',
'HOST',
'HTMLBaseComponent',
'HTMLEntity',
'HTMLParser',
'HTTPEndpoint',
'HTTPSRedirectMiddleware',
'Header',
'Hello',
'HighCharts',
'HighStock',
'Histogram',
'Homepage',
'Hr',
'I',
'Icon',
'Iframe',
'Image',
'Img',
'Input',
'InputChangeOnly',
'Ins',
'JSONResponse',
'Jinja2Templates',
'JpRoute',
'JustPy',
'JustPyAccessor',
'JustpyBaseComponent',
'JustpyEvents',
'KATEX',
'Kbd',
'LATENCY',
'LOGGING_LEVEL',
'Label',
'Legend',
'Li',
'Line',
'LinearGradient',
'Link',
'LinkedChartGrid',
'MEMORY_DEBUG',
'Main',
'Map',
'Mark',
'Markdown',
'Marker',
'Mask',
'Matplotlib',
'MeadowsPage',
'Metadata',
'Meter',
'MethodType',
'Middleware',
'Mpath',
'NO_INTERNET',
'Nav',
'NewParser',
'Object',
'Ol',
'Optgroup',
'Option',
'P',
'PLOTLY',
'PORT',
'PROTOCOL_SSLv23',
'Param',
'Path',
'Pattern',
'Picture',
'Pie',
'PieSemiCircle',
'PlainTextResponse',
'Polygon',
'Polyline',
'Pre',
'Progress',
'PyDeck',
'PyDeckFrame',
'Q',
'QAjaxBar',
'QAvatar',
'QBadge',
'QBanner',
'QBar',
'QBreadcrumbs',
'QBreadcrumbsEl',
'QBtn',
'QBtnDropdown',
'QBtnGroup',
'QBtnToggle',
'QButton',
'QCard',
'QCardActions',
'QCardSection',
'QChatMessage',
'QCheckbox',
'QChip',
'QCircularProgress',
'QColor',
'QDate',
'QDialog',
'QDiv',
'QDrawer',
'QEditor',
'QExpansionItem',
'QFab',
'QFabAction',
'QField',
'QFooter',
'QForm',
'QHeader',
'QHello',
'QIcon',
'QImg',
'QInfiniteScroll',
'QInnerLoading',
'QInput',
'QInputBase',
'QInputBlur',
'QInputChange',
'QInputDate',
'QInputDateTime',
'QItem',
'QItemLabel',
'QItemSection',
'QKnob',
'QLayout',
'QLinearProgress',
'QList',
'QMarkupTable',
'QMenu',
'QNotify',
'QOptionGroup',
'QPage',
'QPageContainer',
'QPageScroller',
'QPageSticky',
'QPagination',
'QParallax',
'QPopupEdit',
'QPopupProxy',
'QRange',
'QRating',
'QResizeObserver',
'QScrollArea',
'QScrollObserver',
'QSelect',
'QSeparator',
'QSkeleton',
'QSlideItem',
'QSlideTransition',
'QSlider',
'QSpace',
'QSpinner',
'QSplitter',
'QStep',
'QStepper',
'QStepperNavigation',
'QTab',
'QTabPanel',
'QTabPanels',
'QTable',
'QTabs',
'QTd',
'QTh',
'QTime',
'QTimeline',
'QTimelineEntry',
'QToggle',
'QToolbar',
'QToolbarTitle',
'QTooltip',
'QTr',
'QTree',
'QUASAR',
'QUASAR_VERSION',
'QVideo',
'QuasarMeadowsPage',
'QuasarPage',
'RadialGradient',
'Rb',
'Rect',
'Register',
'Response',
'Route',
'Rp',
'Rt',
'Rtc',
'Ruby',
'S',
'SECRET_KEY',
'SESSIONS',
'SESSION_COOKIE_NAME',
'SSL_CERTFILE',
'SSL_KEYFILE',
'SSL_VERSION',
'STATIC_DIRECTORY',
'STATIC_NAME',
'STATIC_ROUTE',
'Samp',
'Scatter',
'Section',
'Select',
'Set',
'SetRoute',
'Signer',
'Small',
'Source',
'Space',
'Span',
'Starlette',
'StaticFiles',
'Stop',
'StringIO',
'Strong',
'Style',
'Styles',
'Sub',
'Summary',
'Sup',
'Svg',
'Switch',
'Symbol',
'TAILWIND',
'TEMPLATES_DIRECTORY',
'TabGroup',
'Table',
'Tailwind',
'TailwindUIPage',
'TailwindVersion1Page',
'Tbody',
'Td',
'Template',
'Text',
'TextPath',
'Textarea',
'Tfoot',
'Th',
'Thead',
'Time',
'Timestamp',
'Title',
'ToggleDarkModeBtn',
'Tr',
'Track',
'Transition',
'TransitionGroup',
'Tspan',
'Tt',
'U',
'UVICORN_LOGGING_LEVEL',
'Ul',
'Use',
'VEGA',
'Var',
'Video',
'View',
'Wbr',
'WebPage',
'WebSocketEndpoint',
'__builtins__',
'__cached__',
'__doc__',
'__file__',
'__loader__',
'__name__',
'__package__',
'__path__',
'__spec__',
'__version__',
'aiofiles',
'alt',
'app',
'asyncio',
'attrfind_tolerant',
'bokeh',
'c_tag',
'chartcomponents',
'component_by_tag',
'component_file_list',
'config',
'convert_dict_to_object',
'cookie_signer',
'copy',
'create_component_file_list',
'create_delayed_task',
'create_transition',
'current_dir',
'current_module',
'demjson',
'fnmatch',
'func_to_run',
'get',
'getServer',
'get_tag',
'get_websocket',
'gridcomponents',
'handle_event',
'htmlcomponents',
'httpx',
'i',
'initial_func',
'inspect',
'io',
'is_datetime64_any_dtype',
'is_numeric_dtype',
'itertools',
'jp_server',
'json',
'justPY_parser',
'justpy',
'justpy_startup',
'k',
'logging',
'make_pairs_list',
'markdown',
'meadows',
'middleware',
'name2codepoint',
'new_parse_meadows_html',
'new_parse_meadows_html_file',
'np',
'os',
'pandas',
'parse_dict',
'parse_html',
'parse_html_file',
'parse_html_file_async',
'pd',
'pdk',
'plt',
'quasar_directives',
'quasarcomponents',
'quote',
're',
'read_csv_from_string',
'redirect',
'register_component',
'routing',
'run_task',
's',
'server_error_func',
'startup_func',
'svg_animation_attributes',
'svg_attr_dict',
'svg_attr_translate_dict',
'svg_filter_attributes',
'svg_presentation_attributes',
'svg_tags',
'svg_tags_use',
'sys',
'tag',
'tagfind_tolerant',
'tailwind',
'template_options',
'templates',
'tokenize',
'traceback',
'unescape',
'update_eval',
'update_lists',
'utilities',
'uuid',
'uvicorn',
'v']``` |
Beta Was this translation helpful? Give feedback.
-
the line
has potentially horrible sideffects.
Currently a simple
from justpy.download import Download
will lead to
so we initialize a lot of code just for an import.
That approach might have been convenient in the past. It already gave some trouble in the past few days since e.g. i couldn't find out a namespace problem for the love of it and hat to use jp.getServer() just to access a global variable.
I think we have to get rid of all global variables and global namespace handling and think of a better startup procedure.
Beta Was this translation helpful? Give feedback.
All reactions