bcpkgfox 0.16.27__py3-none-any.whl → 0.16.29__py3-none-any.whl

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.
bcpkgfox/__init__.py CHANGED
@@ -225,7 +225,7 @@ def wait_for_element_disappear(object, type, timeout=10):
225
225
 
226
226
  return find_elements.backcode__dont_use__wait_for_d(driver, object, type, timeout=tempo)
227
227
 
228
- def selectfox(elemento, method, key, pure: None):
228
+ def selectfox(elemento, method, key, pure = None):
229
229
  """
230
230
  Seleciona uma opção em um elemento <select>.
231
231
 
@@ -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.27
3
+ Version: 0.16.29
4
4
  Summary: Biblioteca BCFOX
5
5
  Home-page: https://github.com/robotsbcfox/PacotePythonBCFOX
6
6
  Author: Guilherme Neri
@@ -1,4 +1,4 @@
1
- bcpkgfox/__init__.py,sha256=rQUidstj6OyeKaqB7qXDUXeN41owoGyWnJuJ_ir54m4,16138
1
+ bcpkgfox/__init__.py,sha256=dUyJAUKjDMwcV69wf9AXQvA-p-tsP1mgKttUr8z7gaM,16498
2
2
  bcpkgfox/clean.py,sha256=80pJDTGmKmPiq73uL1IWopuxqVJF_bj_RVv-njkpl-A,8946
3
3
  bcpkgfox/cli.py,sha256=l6GnGmOsx3heYO3h06O6v7Mv6N0nGqnJ9Z0EVrHy1aY,31096
4
4
  bcpkgfox/exec_file.py,sha256=fl_Do2SlF7JuXazpNTod-e_0WZUk355fbd7ustQvi40,3728
@@ -6,8 +6,8 @@ bcpkgfox/find_elements.py,sha256=oeB-73LqMLoKchozPXuxRkThBju9IgUKqbgU-2AAq0s,230
6
6
  bcpkgfox/get_driver.py,sha256=ohimk9E2hL6T35IXv0XX0uvWDGCUZvZDlPMnuRjV1R0,30490
7
7
  bcpkgfox/invoke_api.py,sha256=UTksbSmg6yucWk-egH1gavYoViKvpUq-OAp5t308ZmY,5334
8
8
  bcpkgfox/system.py,sha256=U5vEReSVIQ7LZ-1slUglNyU6k0Vahfioozm6QVEIqfE,6732
9
- bcpkgfox-0.16.27.dist-info/METADATA,sha256=5eX0E5EwfUGh62Waqe6B8hJ2VM03tqwZse4K-5ZdApM,1912
10
- bcpkgfox-0.16.27.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
11
- bcpkgfox-0.16.27.dist-info/entry_points.txt,sha256=qmaEg6K7Y0HOeaFo-G6lf44InGkeVI4I6hqobcY_nns,653
12
- bcpkgfox-0.16.27.dist-info/top_level.txt,sha256=h01SqyYBEfS72vkRFOlEDZBUSu9pzU0bdX4m9hWNNmw,9
13
- bcpkgfox-0.16.27.dist-info/RECORD,,
9
+ bcpkgfox-0.16.29.dist-info/METADATA,sha256=nN05pLqZiaJ71i5zPRbq3WFOeDpmktoaozOUb4hUstQ,1912
10
+ bcpkgfox-0.16.29.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
11
+ bcpkgfox-0.16.29.dist-info/entry_points.txt,sha256=qmaEg6K7Y0HOeaFo-G6lf44InGkeVI4I6hqobcY_nns,653
12
+ bcpkgfox-0.16.29.dist-info/top_level.txt,sha256=h01SqyYBEfS72vkRFOlEDZBUSu9pzU0bdX4m9hWNNmw,9
13
+ bcpkgfox-0.16.29.dist-info/RECORD,,