Zelyanoth commited on
Commit
3487183
·
1 Parent(s): c9329ee

Add compiled Python bytecode for line_db and timing_lin modules

Browse files

- Generated bytecode for line_db.py, containing functionalities for database management, user authentication, and data fetching.
- Generated bytecode for timing_lin.py, which includes scheduling and time manipulation features.

Post_management.py CHANGED
@@ -5,36 +5,41 @@ from functi import post_generation,post_publishing,authen,add_scheduling,delete_
5
  days_of_week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
6
  Social_network_menu = ["Linkedin"]
7
 
 
8
  with tgb.Page(class_name="bodyp") as Post_manag :
9
  with tgb.part(class_name="source_body") :
10
- tgb.text("Post Managements ",class_name="Title_Page")
11
  with tgb.part(class_name="layout_top") :
12
- tgb.text("Linking Account",class_name="header-burgundy")
13
- with tgb.layout(columns="2fr 1",class_name="table_t") :
14
- with tgb.part() :
15
- with tgb.layout(columns="1 1 1") :
16
- tgb.input("{Linked_account_name}" ,label ="Choose an account name",change_delay = -1,action_on_blur = True)
17
- tgb.selector("{Linked_social_network}", lov=Social_network_menu,dropdown=True) # type: ignore
18
- tgb.button(label = "Add account", on_action = authen)
19
- tgb.table("{data_account}",editable = True, on_add = False,on_edit = False,on_delete = delete_account,columns="social_network;account_name")
20
- with tgb.part(class_name="table_s") :
21
- tgb.text("Demo",class_name="header-burgundy table_t")
22
- tgb.button(label = "Generate a post",on_action = post_generation)
23
- tgb.text("{generated_post}",mode = "pre",class_name="burgundy-border",width= "45%")
24
- tgb.button(label = "Publish", on_action = post_publishing)
25
  with tgb.part(class_name="table_s") :
26
- tgb.text("Post Scheduling",class_name="header-burgundy")
27
- with tgb.layout(columns = "3fr 1", class_name="table_t" ) :
28
- with tgb.layout( columns="1 1 1 1") :
29
- tgb.input("{time_value_hour}",label = "Hour",change_delay = -1,action_on_blur = True)
30
- tgb.input("{time_value_minute}",label = "Minute",change_delay = -1,action_on_blur = True)
31
- tgb.selector("{day_value}", lov=days_of_week,multiple = True,dropdown=True,show_select_all=True) # type: ignore
32
- tgb.button(label = "Add",on_action = add_scheduling)
33
- tgb.text("")
34
- tgb.table("{data_schedule}",editable = True, on_add = False,on_edit = False,on_delete = delete_schedule,class_name="table_t")
35
-
 
 
 
 
 
 
 
 
 
 
 
36
 
37
  # Date complète
38
  # tgb.date("{day_value}", format="EEEE, MMM dd, yyyy", label="Full Date with Day")
39
-
40
-
 
5
  days_of_week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
6
  Social_network_menu = ["Linkedin"]
7
 
8
+
9
  with tgb.Page(class_name="bodyp") as Post_manag :
10
  with tgb.part(class_name="source_body") :
11
+ tgb.text("Post Management", class_name="Title_Page")
12
  with tgb.part(class_name="layout_top") :
13
+ tgb.text("Linking Account", class_name="header-burgundy")
14
+ with tgb.layout(columns="1", class_name="table_t") : # Single column for full width
15
+ with tgb.layout(columns="1 1 1", gap="16px") : # Add gap for harmony
16
+ tgb.input("{Linked_account_name}", label="Account name", change_delay=-1, action_on_blur=True, width="100%")
17
+ tgb.selector("{Linked_social_network}", lov=Social_network_menu, dropdown=True, label="Select platform", width="100%")
18
+ tgb.button(label="Add account", on_action=authen, class_name="btn-burgundy", width="100%")
19
+ tgb.table("{data_account}", editable=True, on_add=False, on_edit=False, on_delete=delete_account, columns="social_network;account_name", width="100%")
 
 
 
 
 
 
20
  with tgb.part(class_name="table_s") :
21
+ tgb.text("Demo", class_name="header-burgundy table_t")
22
+ tgb.button(label="Generate a post", on_action=post_generation, class_name="btn-burgundy", width="100%")
23
+ tgb.input("{generated_post}", multiline=True, class_name="burgundy-border", width="100%")
24
+ tgb.button(label="Publish", on_action=post_publishing, width="100%")
25
+ with tgb.part(class_name="table_s") :
26
+ tgb.text("Post Scheduling", class_name="header-burgundy") # Ajoute un peu d'espace en bas du titre
27
+ # Texte explicatif juste en dessous du titre, avec exemple
28
+ tgb.text(
29
+ " Pour garantir la bonne planification, l'heure choisie doit être au moins 10 minutes après l'heure actuelle. "
30
+ "Par exemple, si il est 14h00, choisissez au minimum 14h10. "
31
+ "Sinon, la tâche sera programmée pour la prochaine occurrence du créneau choisi.",
32
+ class_name="info-message"
33
+
34
+ )
35
+ with tgb.layout(columns="1", class_name="table_t") :
36
+ with tgb.layout(columns="1 1 1 1", gap="16px") :
37
+ tgb.input("{time_value_hour}", label="Hour", change_delay=-1, action_on_blur=True, width="100%")
38
+ tgb.input("{time_value_minute}", label="Minute", change_delay=-1, action_on_blur=True, width="100%")
39
+ tgb.selector("{day_value}", lov=days_of_week, multiple=True, dropdown=True, show_select_all=True, width="100%")
40
+ tgb.button(label="Add", on_action=add_scheduling, width="100%")
41
+ tgb.table("{data_schedule}", editable=True, on_add=False, on_edit=False, on_delete=delete_schedule, class_name="table_t", width="100%")
42
 
43
  # Date complète
44
  # tgb.date("{day_value}", format="EEEE, MMM dd, yyyy", label="Full Date with Day")
45
+
 
__pycache__/Post_management.cpython-311.pyc ADDED
Binary file (5.27 kB). View file
 
__pycache__/Source_manage.cpython-311.pyc ADDED
Binary file (3.25 kB). View file
 
__pycache__/functi.cpython-311.pyc ADDED
Binary file (21.6 kB). View file
 
__pycache__/line_db.cpython-311.pyc ADDED
Binary file (9.39 kB). View file
 
__pycache__/timing_lin.cpython-311.pyc ADDED
Binary file (3.09 kB). View file
 
app.py CHANGED
@@ -41,6 +41,9 @@ Découvrez Lin votre assistant community manager sur Linkedin
41
 
42
 
43
  def on_navigate(state, page_name: str):
 
 
 
44
  if page_name == "callback":
45
  raw = request.environ.get("REQUEST_URI", "")
46
 
@@ -170,7 +173,7 @@ if __name__ == "__main__":
170
  gui = Gui(pages=pages)
171
  gui.run(
172
  debug=True,
173
- port=7860,host = "0.0.0.0",
174
  stylekit=stylekit,
175
  title="Lin",
176
  dark_mode=False,
 
41
 
42
 
43
  def on_navigate(state, page_name: str):
44
+ # Redirige vers Accueil si l'utilisateur n'est pas connecté et qu'il ne s'agit pas de la page d'accueil
45
+
46
+
47
  if page_name == "callback":
48
  raw = request.environ.get("REQUEST_URI", "")
49
 
 
173
  gui = Gui(pages=pages)
174
  gui.run(
175
  debug=True,
176
+ # port=7860,host = "0.0.0.0",
177
  stylekit=stylekit,
178
  title="Lin",
179
  dark_mode=False,
functi.py CHANGED
@@ -418,7 +418,12 @@ def on_login(state, payload):
418
 
419
 
420
  else:
421
- state.message = message
 
 
 
 
 
422
 
423
  def on_register(state):
424
  """Handle registration form submission"""
@@ -442,14 +447,14 @@ def on_register(state):
442
  success, message,user_inf = db_manager.create_user(email, password) # type: ignore
443
 
444
  if success:
445
- state.message = "Registration successful! Please log in."
446
  state.show_register = False
447
  # Clear form
448
  state.register_email = ""
449
  state.register_password = ""
450
  state.confirm_password = ""
451
  else:
452
- state.message = message
453
 
454
  def on_logout(state):
455
 
 
418
 
419
 
420
  else:
421
+ if message == "Compte non confirmé":
422
+ state.message = "Votre compte n'est pas encore activé. Veuillez vérifier votre email pour activer votre compte."
423
+ elif message == "Compte non existant":
424
+ state.message = "Email ou mot de passe incorrect."
425
+ else:
426
+ state.message = "Email ou mot de passe incorrect."
427
 
428
  def on_register(state):
429
  """Handle registration form submission"""
 
447
  success, message,user_inf = db_manager.create_user(email, password) # type: ignore
448
 
449
  if success:
450
+ state.message = "Un lien d'activation a été envoyé à votre adresse email. Veuillez vérifier votre boîte de réception pour activer votre compte."
451
  state.show_register = False
452
  # Clear form
453
  state.register_email = ""
454
  state.register_password = ""
455
  state.confirm_password = ""
456
  else:
457
+ state.message = message or "Erreur lors de l'inscription. Veuillez réessayer."
458
 
459
  def on_logout(state):
460