This commit is contained in:
yumoqing 2022-08-26 12:53:06 +08:00
parent 89343bb43e
commit 48ecc1c5e3
4 changed files with 68 additions and 0 deletions

32
test/README.md Normal file
View File

@ -0,0 +1,32 @@
# Kivyblocks test
## hello kivyblocks
```
python main.py
```
## script
this is a standalone mode deploy
```
cd test/scrip
python main.py
```
## gadget
[gadget](https://github.com/yumoqing/gadget) is a light wight web server, please read it documents to learn how to install and configure it to run it.
you need to start the gadget and change the port in test/gadget/conf/config.json before to run the following command
### download and run gadget
```
git clone git@github.com/yumoqing/gadget.git
pip install -r requirements.txt
cd gadget/test
python ../src/gadget.py
```
if it run success, gadget is listen on prot 9080, then switch back to kivyblocks folder, then
```
cd test/gadget
python main.py
```

View File

@ -0,0 +1,18 @@
{
"font_sizes":{
"smallest":1.5,
"small":2.5,
"normal":3.5,
"large":4.5,
"huge":5.5,
"hugest":6.5
},
"font_name":"normal",
"script_root":"$[workdir]$/scripts",
"root":{
"widgettype":"urlwidget",
"options":{
"url":"http://localhost:9080/index.tmpl"
}
}
}

10
test/gadget/main.py Normal file
View File

@ -0,0 +1,10 @@
from kivyblocks.blocksapp import BlocksApp
from kivyblocks.blocks import registerWidget, Blocks
import kivyblocks.register
class ScriptApp(BlocksApp):
pass
if __name__ == '__main__':
ScriptApp().run()

View File

@ -41,6 +41,14 @@ class ResponsiveLayout(ScrollView):
self.options = options self.options = options
super().__init__(**options) super().__init__(**options)
self._inner = VGridLayout(cols=cols,box_width=box_width) self._inner = VGridLayout(cols=cols,box_width=box_width)
self._inner.bind(minimum_height=self._inner.setter('height'))
super().add_widget(self._inner)
def add_widget(self, widget,**kw):
self._inner.add_widget(widget, **kw)
print('here')
class Box(BoxLayout): class Box(BoxLayout):
def __init__(self,**kw): def __init__(self,**kw):