Code Monkey home page Code Monkey logo

pyqtschema's People

Contributors

amsico avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pyqtschema's Issues

add File(s)PathSchemaWidget

give users an option - for json schema properties that are arrays of file paths - to allow user to browse and select multiple files as the input mechanism - the current approach (browsing one at a time for each file path in an array) works well for instances where the number of files in array is small, however this does not work well when the number of file paths is large -

i think this could be implemented fairly easily by

  1. updating pyqtschema/widgets/paths.py to add a new class

class FilesPathSchemaWidget(FilepathSchemaWidget):
def _on_clicked(self, flag):
path = QFileDialog.getOpenFileNames()
self.path_widget.setText(path)

though i suppose you may want to change the qlineedit to a qlistbox and then you may have to parse the input list from the qfiledialog to add each item in the list to the qlistbox..

  1. updating the default_widget_map in the WidgetBuilder class in pyqtschema/builder.py
  2. updating imports to include this new class in several places

AnyOf widgets fails for same type and different format-properties

Consider the following schema, generated with the following BaseModel:

class UnionIssue(BaseModel):
    output: Union[str, Path] = Field(default=None)
{
    'title': 'UnionIssue', 'description': 'Exporter configuration ',
    'type': 'object',
    'properties': {
        'output': {
            'title': 'Output',
            'anyOf': [{'type': 'string'}, {'type': 'string', 'format': 'path'}]
        }
    }
}

Both allowed entries are strings, but the second has an additional path-format.

The schema raises an error:

[...]/pyqtschema/widgets/any_of.py", line 119, in state
    _widgets[idx].state = _dict
IndexError: list index out of range

Agnostic QT support

Hello,

Currently this library uses PyQt5, which means that project using PySide2 or 6, and PyQt6 cannot make use of this library. We could use QtPy to be compatible with all bindings.

I'm willing to do it, but I don't know is this project is still being maintained.

pyqtschema taking too long to install in pyqt6

I am installing pyqtschema version 0.1.9 and I am using pyqt6 as I am on mac m1, so I have to use pyqt6

After installing pyqtschema I am getting following error and it's taking too long to install

/Users/danyalaslam/.zshrc:11: no such file or directory: /Users/danyalaslam/.rbenv/bin/rbenv
/Users/danyalaslam/.zshrc:12: no such file or directory: /Users/danyalaslam/.rbenv/bin/rbenv
(venv_3.11) danyalaslam@Danyals-MacBook-Pro FA4.0 % pip install pyqtschema
Collecting pyqtschema
Using cached pyqtschema-0.1.9-py3-none-any.whl (19 kB)
Collecting jsonschema
Using cached jsonschema-4.17.3-py3-none-any.whl (90 kB)
Collecting PyQt5
Using cached PyQt5-5.15.9.tar.gz (3.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... -

Spin-Widgets should respect min/max and steps

spin respect min/max and steps
The problem of course is that if multiple of is not satisfied at
initialization, then it can't be satisfied using only up and down. In
this case the user must type the number by hand.

Once it's satisfied however, the number will always keep satisfying
the constraint

Source

Allow resolving arbitrarily deep references

Referncing appears to require specific format (i.e. #/definition/key), not allowing for arbitrarily deep references:

"$ref": "#/properties/files/items"

Error:

schema.py", line 54, in resolve_schema _first, definition, key = ident.split('/') 
ValueError: too many values to unpack (expected 3)

Requires 'properties' key, but json schema does not require 'properties' key

It appears to fail to generate form, when properties key is missing. The properties key is not required for json schema fields of type object. It should not be required by the forms generator. Otherwise it should be made clear that the generator requires it. However, in json schema, a field of type object without a properties field is the same as "properties": { } or "additionalProperties": true. Therefore, maybe it should be possible to omit the properties field.

            "unit_under_test": {
			"type": "object",
			"properties": {
				"ego_unit": {
					"description": "The Ego Unit",
					"type": "object"
				}
			}
		}

Error:

groups.py", line 54, in populate_from_schema for name, sub_schema in schema['properties'].items(): KeyError: 'properties'

Level of support for allOf

Hi,

To which extent is the allOf-keyword supported?

I've come across this code:

elif is_all_of(schema):
# workaround for interesting allOf-pydantic behaviour
if len(schema.get('allOf', [])) == 1:
return self.create_widget(schema['allOf'][0], ui_schema, state=state, parent=parent)
else:
raise NotImplementedError('allOf is not supported')
, which leads me to believe that allOf is only supported, if the array contains a single item, not multiple. Is that true? Do any other restrictions exist?

Cheers,
Johannes

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.