소스 검색

Merge branch 'main' of github.com:zauberzeug/nicegui

Rodja Trappe 2 년 전
부모
커밋
670e73b990
4개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 0 1
      main.py
  2. 1 1
      nicegui/elements/element.py
  3. 0 1
      tests/test_3d_scene.py
  4. 3 1
      tests/test_element.py

+ 0 - 1
main.py

@@ -1,5 +1,4 @@
 #!/usr/bin/env python3
 #!/usr/bin/env python3
-import asyncio
 import inspect
 import inspect
 import re
 import re
 from contextlib import contextmanager
 from contextlib import contextmanager

+ 1 - 1
nicegui/elements/element.py

@@ -70,7 +70,7 @@ class Element:
         This can be helpful if the predefined style sheet definitions by NiceGUI are not wanted in a particular styling.
         This can be helpful if the predefined style sheet definitions by NiceGUI are not wanted in a particular styling.
         '''
         '''
         def str_to_dict(s: Optional[str]) -> Dict[str, str]:
         def str_to_dict(s: Optional[str]) -> Dict[str, str]:
-            return dict((word.strip() for word in part.split(':')) for part in s.split(';')) if s else {}
+            return dict((word.strip() for word in part.split(':')) for part in s.strip('; ').split(';')) if s else {}
         style_dict = str_to_dict((self.view.style or '').strip('; ')) if replace is None else {}
         style_dict = str_to_dict((self.view.style or '').strip('; ')) if replace is None else {}
         for key in str_to_dict(remove):
         for key in str_to_dict(remove):
             del style_dict[key]
             del style_dict[key]

+ 0 - 1
tests/test_3d_scene.py

@@ -1,4 +1,3 @@
-
 from nicegui import ui
 from nicegui import ui
 
 
 from .user import User
 from .user import User

+ 3 - 1
tests/test_element.py

@@ -1,7 +1,6 @@
 
 
 from nicegui import ui
 from nicegui import ui
 from selenium.webdriver.common.action_chains import ActionChains
 from selenium.webdriver.common.action_chains import ActionChains
-from selenium.webdriver.common.keys import Keys
 
 
 from .user import User
 from .user import User
 
 
@@ -69,6 +68,9 @@ def test_style(user: User):
     label.style(replace='text-decoration: underline')
     label.style(replace='text-decoration: underline')
     assert_style('text-decoration: underline;')
     assert_style('text-decoration: underline;')
 
 
+    label.style('color: blue;')
+    assert_style('text-decoration: underline; color: blue;')
+
 
 
 def test_props(user: User):
 def test_props(user: User):
     input = ui.input()
     input = ui.input()