ChaterJee 0.5.9__py3-none-any.whl → 0.6.1__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.
ChaterJee/ChaterJee.py CHANGED
@@ -15,6 +15,7 @@ import threading
15
15
  import subprocess
16
16
  from subprocess import PIPE, Popen
17
17
  from pathlib import Path
18
+ import argparse
18
19
 
19
20
  start_txt = \
20
21
  """
@@ -495,3 +496,33 @@ class NoteLogs:
495
496
  json.dump(jobs, ffw, indent=4)
496
497
 
497
498
 
499
+ def register():
500
+ parser = argparse.ArgumentParser(description="I am ChaterJee register, I note your jobs for keeping logs.")
501
+ parser.add_argument("command",type=str,help="command to run in your terminal")
502
+ parser.add_argument("--jobname","-n",type=str,help="name of the job for logging",required=True)
503
+ parser.add_argument("--logdir",default=None,type=str,help="log directory path")
504
+ parser.add_argument("--logfile",default=None,type=str,help="log file path")
505
+ parser.add_argument("--logimage",default=None,type=str,help="log image path")
506
+ args = parser.parse_args()
507
+ logDIR = args.logdir
508
+ if logDIR is None:
509
+ logDIR = Path.cwd() / args.jobname
510
+ else:
511
+ logDIR = Path(logDIR) / args.jobname
512
+
513
+ job = NoteLogs(args.jobname)
514
+ job.save_job_JSON()
515
+ with open(args.logfile, "w") as out, open("error.log", "w") as err:
516
+ subprocess.Popen(
517
+ [f"{args.command}"],
518
+ stdout=out,
519
+ stderr=err,
520
+ )
521
+
522
+ def updater():
523
+ parser = argparse.ArgumentParser(description="I am ChaterJee updater, I update your registered project logs.")
524
+ parser.add_argument("token",type=str,help="Enter your telegram-bot TOKEN here")
525
+ parser.add_argument("chatid",type=str,help="Enter your telegram-bot CHATID here")
526
+ args = parser.parse_args()
527
+ cbot = ChatLogs(args.token, args.chatid)
528
+ cbot.cmdTRIGGER()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ChaterJee
3
- Version: 0.5.9
3
+ Version: 0.6.1
4
4
  Summary: Communicate your project updates via Telegram Bot!
5
5
  Author: Pallab Dutta
6
6
  Author-email: pallab9997@gmail.com
@@ -0,0 +1,7 @@
1
+ ChaterJee/ChaterJee.py,sha256=ZdCX69qwzdOpoM4UqZzMxBs4Ff_eD3aQ-I5GZT6q89I,21459
2
+ ChaterJee/__init__.py,sha256=tZmkZY2XbzJ8rHDh8nOmb1W73kPecPv3xcEiCPwkZf4,98
3
+ chaterjee-0.6.1.dist-info/METADATA,sha256=l1b-wOip9fkdZavM88skkA86xhnQXFGwUQSHXWBkoXU,6723
4
+ chaterjee-0.6.1.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
5
+ chaterjee-0.6.1.dist-info/entry_points.txt,sha256=MCOBbAWR8oBPX7h6flYn8SGUtoXTQR_qO6iLPRv4Zhc,95
6
+ chaterjee-0.6.1.dist-info/top_level.txt,sha256=Z1UAYoaNybpDiKjqa1yFpti_q0FNECVItb3-9yAh3gM,10
7
+ chaterjee-0.6.1.dist-info/RECORD,,
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ chatjee = ChaterJee.ChaterJee:updater
3
+ notejee = ChaterJee.ChaterJee:register
@@ -1,6 +0,0 @@
1
- ChaterJee/ChaterJee.py,sha256=GGWuqsi89yfgJMVbvDxTY21qSew_5zbSZsXBFLrEjK8,20075
2
- ChaterJee/__init__.py,sha256=tZmkZY2XbzJ8rHDh8nOmb1W73kPecPv3xcEiCPwkZf4,98
3
- chaterjee-0.5.9.dist-info/METADATA,sha256=EPC3B_0JZtYZTK1ZVAmvNnFahahlWTBRR7sLsvH9ndc,6723
4
- chaterjee-0.5.9.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
5
- chaterjee-0.5.9.dist-info/top_level.txt,sha256=Z1UAYoaNybpDiKjqa1yFpti_q0FNECVItb3-9yAh3gM,10
6
- chaterjee-0.5.9.dist-info/RECORD,,