Skip to content

Commit c95d735

Browse files
committed
autocomplete for pycharm
1 parent 2f27a02 commit c95d735

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

flowpython.incantation/Module/Component/Badges.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@
88

99
from ..abst import abstract_object,indent_setter, Seq, default_attr, attrset_sugar
1010

11-
def badge(name, href = '#!', new:{True,False,None} = None, num = "", color = ''):
12-
if new is None:
13-
return dict(href=href, style=f"{name}")
14-
class_ = 'new badge' if new else 'badge'
15-
if color: class_ += color
16-
return dict(href = href, style = f'{name}<span class="{class_}">{num}</span>')
11+
class badge:
12+
"""
13+
badge(name, new=False, href='', color='')
14+
"""
15+
def __new__(self, name, href = '#!', new:{True,False,None} = None, num = "", color = ''):
16+
if new is None:
17+
return dict(href=href, style=f"{name}")
18+
class_ = 'new badge' if new else 'badge'
19+
if color: class_ += color
20+
return dict(href = href, style = f'{name}<span class="{class_}">{num}</span>')
1721

1822

1923
class collections(indent_setter, abstract_object):

flowpython.incantation/Module/Component/Form.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def init(self, grid : "CSS.Grid.grid" , **attributes):
2727
sugar = attrset_sugar(self.conf, attributes)
2828
sugar('icon', None)
2929
sugar('id', 'Some Id')
30+
sugar('value', None)
3031
sugar('type', 'text')
3132
sugar('field_name', 'Some Field')
3233
if self.conf['type'].lower() == 'submit':
@@ -46,7 +47,7 @@ def init(self, grid : "CSS.Grid.grid" , **attributes):
4647
{% if icon %}
4748
{{indent+Indent_unit}}<i class="material-icons prefix">{{icon}}</i>
4849
{% endif %}
49-
{{indent+Indent_unit}}<input id="{{id}}" name = "{{id}}" class="{{class}}" type = "{{type}}">
50+
{{indent+Indent_unit}}<input id="{{id}}" name="{{id}}" class="{{class}}" type="{{type}}"{%- if value %} value="{{value}}" {% endif %}>
5051
{{indent+Indent_unit}}<label for="{{id}}">{{field_name}}</label>
5152
{{indent}}</div>
5253
"""
206 Bytes
Binary file not shown.
60 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)