bcpkgfox 0.16.28__tar.gz → 0.16.30__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bcpkgfox
3
- Version: 0.16.28
3
+ Version: 0.16.30
4
4
  Summary: Biblioteca BCFOX
5
5
  Home-page: https://github.com/robotsbcfox/PacotePythonBCFOX
6
6
  Author: Guilherme Neri
@@ -262,7 +262,7 @@ def selectfox(elemento, method, key, pure = None):
262
262
  select.select_by_value(key)
263
263
 
264
264
  if method == "text":
265
- elements = WebDriverWait(elemento, 10).until(EC.visibility_of_all_elements_located((By.XPATH, '//option')))
265
+ elements = select.options
266
266
  for elm in elements:
267
267
  if pure:
268
268
  if key == elm.text:
@@ -354,18 +354,15 @@ def mostrar_mensagem(mensagem, tamanho_fonte=12, negrito=False, button: Optional
354
354
  janela.title("Atenção!")
355
355
  janela.configure(bg="white")
356
356
 
357
- largura, altura = 400, 200
358
- pos_x = (janela.winfo_screenwidth() - largura) // 2
359
- pos_y = (janela.winfo_screenheight() - altura) // 2
360
- janela.geometry(f"{largura}x{altura}+{pos_x}+{pos_y}")
361
- janela.resizable(False, False)
362
- janela.attributes("-topmost", True)
363
-
364
357
  estilo_fonte = ("Helvetica", tamanho_fonte, "bold" if negrito else "normal")
365
358
 
366
- label = tk.Label(janela, text=mensagem, bg="white", fg="black",
367
- font=estilo_fonte, wraplength=380, justify="center")
368
- label.pack(expand=True, padx=20, pady=20)
359
+ # container para label + botões
360
+ container = tk.Frame(janela, bg="white")
361
+ container.pack(padx=20, pady=20)
362
+
363
+ label = tk.Label(container, text=mensagem, bg="white", fg="black",
364
+ font=estilo_fonte, wraplength=360, justify="center")
365
+ label.pack(fill="both", expand=True)
369
366
 
370
367
  if isinstance(button, dict):
371
368
  resultado = tk.IntVar()
@@ -373,33 +370,46 @@ def mostrar_mensagem(mensagem, tamanho_fonte=12, negrito=False, button: Optional
373
370
  def make_cmd(value):
374
371
  return lambda: resultado.set(value)
375
372
 
376
- frame_botoes = tk.Frame(janela, bg="white") # CRIAR O FRAME
377
- frame_botoes.pack(pady=10) # EMPACOTAR O FRAME
378
-
373
+ frame_botoes = tk.Frame(container, bg="white")
374
+ frame_botoes.pack(pady=10)
379
375
  for i, texto in enumerate(button.keys(), start=1):
380
376
  tk.Button(frame_botoes, text=texto, command=make_cmd(i), width=10,
381
377
  font=("Helvetica", 10)).pack(side="left", padx=5)
382
378
 
383
379
  janela.grab_set()
384
380
  janela.focus_set()
381
+ janela.update_idletasks()
382
+ # ajusta ao tamanho real
383
+ w = janela.winfo_reqwidth()
384
+ h = janela.winfo_reqheight()
385
+ x = (janela.winfo_screenwidth() - w) // 2
386
+ y = (janela.winfo_screenheight() - h) // 2
387
+ janela.geometry(f"{w}x{h}+{x}+{y}")
385
388
  janela.wait_variable(resultado)
386
389
  root.destroy()
387
390
  return resultado.get()
388
391
 
389
392
  else:
390
393
  if button:
391
- tk.Button(janela, text="OK", command=lambda: (janela.destroy(), root.destroy()),
394
+ tk.Button(container, text="OK",
395
+ command=lambda: (janela.destroy(), root.destroy()),
392
396
  width=10, font=("Helvetica", 10)).pack(pady=10)
393
397
 
394
398
  janela.grab_set()
395
399
  janela.focus_set()
400
+ janela.update_idletasks()
401
+ w = janela.winfo_reqwidth()
402
+ h = janela.winfo_reqheight()
403
+ x = (janela.winfo_screenwidth() - w) // 2
404
+ y = (janela.winfo_screenheight() - h) // 2
405
+ janela.geometry(f"{w}x{h}+{x}+{y}")
406
+
396
407
  if button:
397
408
  janela.wait_window()
398
409
  else:
399
410
  root.mainloop()
400
411
  return janela
401
412
 
402
-
403
413
  def fechar_janela(janela_=None):
404
414
  global janela
405
415
  if janela_ == None: janela.destroy()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bcpkgfox
3
- Version: 0.16.28
3
+ Version: 0.16.30
4
4
  Summary: Biblioteca BCFOX
5
5
  Home-page: https://github.com/robotsbcfox/PacotePythonBCFOX
6
6
  Author: Guilherme Neri
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="bcpkgfox",
5
- version="0.16.28",
5
+ version="0.16.30",
6
6
  author="Guilherme Neri",
7
7
  author_email="guilherme.neri@bcfox.com.br",
8
8
  description="Biblioteca BCFOX",
File without changes
File without changes
File without changes
File without changes