halib 0.1.27__tar.gz → 0.1.29__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.
Files changed (32) hide show
  1. {halib-0.1.27/halib.egg-info → halib-0.1.29}/PKG-INFO +5 -1
  2. {halib-0.1.27 → halib-0.1.29}/README.md +4 -0
  3. {halib-0.1.27 → halib-0.1.29}/halib/tele_noti.py +23 -12
  4. {halib-0.1.27 → halib-0.1.29/halib.egg-info}/PKG-INFO +5 -1
  5. {halib-0.1.27 → halib-0.1.29}/halib.egg-info/requires.txt +1 -0
  6. {halib-0.1.27 → halib-0.1.29}/setup.py +1 -1
  7. {halib-0.1.27 → halib-0.1.29}/.gitignore +0 -0
  8. {halib-0.1.27 → halib-0.1.29}/GDriveFolder.txt +0 -0
  9. {halib-0.1.27 → halib-0.1.29}/LICENSE.txt +0 -0
  10. {halib-0.1.27 → halib-0.1.29}/guide_publish_pip.pdf +0 -0
  11. {halib-0.1.27 → halib-0.1.29}/halib/__init__.py +0 -0
  12. {halib-0.1.27 → halib-0.1.29}/halib/cuda.py +0 -0
  13. {halib-0.1.27 → halib-0.1.29}/halib/filetype/__init__.py +0 -0
  14. {halib-0.1.27 → halib-0.1.29}/halib/filetype/csvfile.py +0 -0
  15. {halib-0.1.27 → halib-0.1.29}/halib/filetype/jsonfile.py +0 -0
  16. {halib-0.1.27 → halib-0.1.29}/halib/filetype/textfile.py +0 -0
  17. {halib-0.1.27 → halib-0.1.29}/halib/filetype/videofile.py +0 -0
  18. {halib-0.1.27 → halib-0.1.29}/halib/filetype/yamlfile.py +0 -0
  19. {halib-0.1.27 → halib-0.1.29}/halib/listop.py +0 -0
  20. {halib-0.1.27 → halib-0.1.29}/halib/online/__init__.py +0 -0
  21. {halib-0.1.27 → halib-0.1.29}/halib/online/gdrive.py +0 -0
  22. {halib-0.1.27 → halib-0.1.29}/halib/online/gdrive_mkdir.py +0 -0
  23. {halib-0.1.27 → halib-0.1.29}/halib/online/gdrive_test.py +0 -0
  24. {halib-0.1.27 → halib-0.1.29}/halib/online/projectmake.py +0 -0
  25. {halib-0.1.27 → halib-0.1.29}/halib/plot.py +0 -0
  26. {halib-0.1.27 → halib-0.1.29}/halib/system/__init__.py +0 -0
  27. {halib-0.1.27 → halib-0.1.29}/halib/system/cmd.py +0 -0
  28. {halib-0.1.27 → halib-0.1.29}/halib/system/filesys.py +0 -0
  29. {halib-0.1.27 → halib-0.1.29}/halib.egg-info/SOURCES.txt +0 -0
  30. {halib-0.1.27 → halib-0.1.29}/halib.egg-info/dependency_links.txt +0 -0
  31. {halib-0.1.27 → halib-0.1.29}/halib.egg-info/top_level.txt +0 -0
  32. {halib-0.1.27 → halib-0.1.29}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: halib
3
- Version: 0.1.27
3
+ Version: 0.1.29
4
4
  Summary: Small library for common tasks
5
5
  Author: Hoang Van Ha
6
6
  Author-email: hoangvanhauit@gmail.com
@@ -15,6 +15,10 @@ License-File: LICENSE.txt
15
15
 
16
16
  Helper package for coding and automation
17
17
 
18
+ **Version 0.1.29**
19
+
20
+ + for `tele_noti` module, `kaleido==0.1.*` is required for plotly since `kaleido 0.2.*` is not working (taking for ever to generate image)
21
+ ---
18
22
  **Version 0.1.24**
19
23
 
20
24
  + rename `sys` to `system` to avoid conflict with built-in `sys` module
@@ -1,5 +1,9 @@
1
1
  Helper package for coding and automation
2
2
 
3
+ **Version 0.1.29**
4
+
5
+ + for `tele_noti` module, `kaleido==0.1.*` is required for plotly since `kaleido 0.2.*` is not working (taking for ever to generate image)
6
+ ---
3
7
  **Version 0.1.24**
4
8
 
5
9
  + rename `sys` to `system` to avoid conflict with built-in `sys` module
@@ -70,6 +70,8 @@ def df2img(df: pd.DataFrame, output_img_dir, decimal_places, out_img_scale):
70
70
  )
71
71
  )
72
72
  ])
73
+ if not os.path.exists(output_img_dir):
74
+ os.makedirs(output_img_dir)
73
75
  img_path = os.path.normpath(os.path.join(output_img_dir, "last_lines.png"))
74
76
  fig.write_image(img_path, scale=out_img_scale)
75
77
  return img_path
@@ -80,7 +82,11 @@ def compose_message_and_img_path(
80
82
  ):
81
83
  context_msg = f">> Project: {project} \n>> File: {target_file} \n>> Last {num_last_lines} lines:"
82
84
  msg_df = get_watcher_message_df(target_file, num_last_lines)
83
- img_path = df2img(msg_df, output_img_dir, decimal_places, out_img_scale)
85
+ try:
86
+ img_path = df2img(msg_df, output_img_dir, decimal_places, out_img_scale)
87
+ except Exception as e:
88
+ pprint(f"Error: {e}")
89
+ img_path = None
84
90
  return context_msg, img_path
85
91
 
86
92
 
@@ -99,17 +105,22 @@ async def send_to_telegram(cfg_dict):
99
105
 
100
106
  bot = telegram.Bot(token=token)
101
107
  async with bot:
102
- context_msg, img_path = compose_message_and_img_path(
103
- target_file,
104
- project,
105
- num_last_lines,
106
- decimal_places,
107
- out_img_scale,
108
- output_img_dir,
109
- )
110
- pprint('Sending message to telegram...')
111
- await bot.send_message(text=context_msg, chat_id=chat_id)
112
- await bot.send_photo(chat_id=chat_id, photo=open(img_path, "rb"))
108
+ try:
109
+ context_msg, img_path = compose_message_and_img_path(
110
+ target_file,
111
+ project,
112
+ num_last_lines,
113
+ decimal_places,
114
+ out_img_scale,
115
+ output_img_dir,
116
+ )
117
+ pprint('Sending message to telegram...')
118
+ await bot.send_message(text=context_msg, chat_id=chat_id)
119
+ if img_path:
120
+ await bot.send_photo(chat_id=chat_id, photo=open(img_path, "rb"))
121
+ except Exception as e:
122
+ pprint(f'Error: {e}')
123
+ pprint('Message not sent to telegram')
113
124
 
114
125
 
115
126
  async def run_forever(cfg_path):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: halib
3
- Version: 0.1.27
3
+ Version: 0.1.29
4
4
  Summary: Small library for common tasks
5
5
  Author: Hoang Van Ha
6
6
  Author-email: hoangvanhauit@gmail.com
@@ -15,6 +15,10 @@ License-File: LICENSE.txt
15
15
 
16
16
  Helper package for coding and automation
17
17
 
18
+ **Version 0.1.29**
19
+
20
+ + for `tele_noti` module, `kaleido==0.1.*` is required for plotly since `kaleido 0.2.*` is not working (taking for ever to generate image)
21
+ ---
18
22
  **Version 0.1.24**
19
23
 
20
24
  + rename `sys` to `system` to avoid conflict with built-in `sys` module
@@ -11,3 +11,4 @@ moviepy
11
11
  tube_dl
12
12
  enlighten
13
13
  pycurl
14
+ kaleido==0.1.*
@@ -8,7 +8,7 @@ with open("requirements.txt") as f:
8
8
 
9
9
  setuptools.setup(
10
10
  name="halib",
11
- version="0.1.27",
11
+ version="0.1.29",
12
12
  author="Hoang Van Ha",
13
13
  author_email="hoangvanhauit@gmail.com",
14
14
  description="Small library for common tasks",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes