ChaterJee 0.5.1__py3-none-any.whl → 0.5.3__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
@@ -116,7 +116,7 @@ class ChatLogs:
116
116
  reply_keyboard = [[f'{job}'] for job in list(self.jobs.keys())[::-1]] # inverse to show latest jobs on top
117
117
  await context.bot.sendChatAction(chat_id=self.CHATID, action="typing")
118
118
  msg = await update.message.reply_text("Select a job to get updates on",\
119
- reply_markup=ReplyKeyboardMarkup(reply_keyboard, one_time_keyboard=True, input_field_placeholder="Select the job."\
119
+ reply_markup=ReplyKeyboardMarkup(reply_keyboard, one_time_keyboard=True, resize_keyboard=True, input_field_placeholder="Select the job."\
120
120
  ),\
121
121
  )
122
122
  self.smsID.append(msg.message_id)
@@ -134,6 +134,7 @@ class ChatLogs:
134
134
  logDIR = Path(jobs[job_name]['logDIR'])
135
135
  logFILE = jobs[job_name]['logFILE']
136
136
  logIMAGE = jobs[job_name]['logIMAGE']
137
+ logDICT = jobs[job_name]['logDICT']
137
138
 
138
139
  self.txt = self.get_last_line(logDIR / logFILE)
139
140
 
@@ -142,6 +143,10 @@ class ChatLogs:
142
143
  #await self.sendUpdate(update, context)
143
144
  #msg = await context.bot.send_message(chat_id=self.CHATID, text=txt)
144
145
  #self.smsID.append(msg.message_id)
146
+ elif logDICT is not None:
147
+ self.txt = self.txt + '\n'
148
+ for key, value in logDICT.items():
149
+ self.txt = self.txt + f"{key}: {value}\n"
145
150
 
146
151
  await context.bot.sendChatAction(chat_id=self.CHATID, action="typing")
147
152
  msg = await update.message.reply_text(
@@ -241,7 +246,7 @@ class ChatLogs:
241
246
  await context.bot.sendChatAction(chat_id=self.CHATID, action="typing")
242
247
  if len(JSONfiles):
243
248
  msg = await update.message.reply_text("Select a JSON file to edit",\
244
- reply_markup=ReplyKeyboardMarkup(JSONfiles, one_time_keyboard=True, input_field_placeholder="Select the file."\
249
+ reply_markup=ReplyKeyboardMarkup(JSONfiles, one_time_keyboard=True, resize_keyboard=True, input_field_placeholder="Select the file."\
245
250
  ),\
246
251
  )
247
252
  self.smsID.append(msg.message_id)
@@ -274,13 +279,15 @@ class ChatLogs:
274
279
  KeyboardButton(
275
280
  text="Editor Babu",
276
281
  web_app=WebAppInfo(url="https://pallab-dutta.github.io/EditorBabu"+extender),
277
- )
282
+ ),
283
+ resize_keyboard=True, one_time_keyboard=True
278
284
  ),
279
285
  )
280
286
  self.smsID.append(msg.message_id)
281
287
  return ConversationHandler.END
282
288
 
283
289
  async def web_app_data(self, update: Update, context: ContextTypes.DEFAULT_TYPE) -> None :
290
+ self.smsID.append(update.message.message_id)
284
291
  data = json.loads(update.effective_message.web_app_data.data)
285
292
  formname = data['formNAME']
286
293
  if formname == 'EditorBabu':
@@ -373,7 +380,7 @@ class ChatLogs:
373
380
  print(reply_keyboard)
374
381
  await context.bot.sendChatAction(chat_id=self.CHATID, action="typing")
375
382
  msg = await update.message.reply_text("Entire chat history in the current session will be cleared. Proceed?",\
376
- reply_markup=ReplyKeyboardMarkup(reply_keyboard, one_time_keyboard=True, input_field_placeholder="Select to proceed."\
383
+ reply_markup=ReplyKeyboardMarkup(reply_keyboard, one_time_keyboard=True, resize_keyboard=True, input_field_placeholder="Select to proceed."\
377
384
  ),\
378
385
  )
379
386
  self.smsID.append(msg.message_id)
@@ -395,7 +402,7 @@ class ChatLogs:
395
402
  print(reply_keyboard)
396
403
  await context.bot.sendChatAction(chat_id=self.CHATID, action="typing")
397
404
  msg = await update.message.reply_text("Your job will be killed. Proceed?",\
398
- reply_markup=ReplyKeyboardMarkup(reply_keyboard, one_time_keyboard=True, input_field_placeholder="Select to proceed."\
405
+ reply_markup=ReplyKeyboardMarkup(reply_keyboard, one_time_keyboard=True, resize_keyboard=True, input_field_placeholder="Select to proceed."\
399
406
  ),\
400
407
  )
401
408
  self.smsID.append(msg.message_id)
@@ -431,8 +438,9 @@ class NoteLogs:
431
438
  self.logDIR = None
432
439
  self.logFILE = None
433
440
  self.logIMAGE = None
441
+ self.logDICT = None
434
442
 
435
- def write(self, jobNAME: str, logDIR: str = None, logSTRING: str = None, logFILE: str = 'log_file.out', logIMAGE: str = 'log_file.png'):
443
+ def write(self, jobNAME: str, logDIR: str = None, logSTRING: str = None, logFILE: str = 'log_file.out', logIMAGE: str = 'log_file.png', logDICT: dict = None):
436
444
  if logDIR is None:
437
445
  pwd = Path.cwd()
438
446
  _logDIR = pwd / jobNAME
@@ -453,6 +461,7 @@ class NoteLogs:
453
461
  self.logDIR = logDIR
454
462
  self.logFILE = logFILE
455
463
  self.logIMAGE = logIMAGE
464
+ self.logDICT = logDICT
456
465
  self.save_job_JSON()
457
466
 
458
467
  def save_job_JSON(self):
@@ -467,7 +476,8 @@ class NoteLogs:
467
476
  jobs[self.jobNAME] = {\
468
477
  "logDIR": self.logDIR, \
469
478
  "logFILE": self.logFILE, \
470
- "logIMAGE": self.logIMAGE \
479
+ "logIMAGE": self.logIMAGE, \
480
+ "logDICT": self.logDICT \
471
481
  }
472
482
  with open(jobs_file, 'w') as ffw:
473
483
  json.dump(jobs, ffw, indent=4)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ChaterJee
3
- Version: 0.5.1
3
+ Version: 0.5.3
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,6 @@
1
+ ChaterJee/ChaterJee.py,sha256=SX5GMijhukAs8fp-IH3AHM_IR2vh5iuSFNkXrhT1OOo,19693
2
+ ChaterJee/__init__.py,sha256=tZmkZY2XbzJ8rHDh8nOmb1W73kPecPv3xcEiCPwkZf4,98
3
+ chaterjee-0.5.3.dist-info/METADATA,sha256=sn74rD6LqCLw98WlXwE8Le9-nnNot4atPEvYWM1b95o,6723
4
+ chaterjee-0.5.3.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
5
+ chaterjee-0.5.3.dist-info/top_level.txt,sha256=Z1UAYoaNybpDiKjqa1yFpti_q0FNECVItb3-9yAh3gM,10
6
+ chaterjee-0.5.3.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- ChaterJee/ChaterJee.py,sha256=KTy0k3tQ_r4Fbgu_BKn7hpT95cINYH6sy-S7O-05Q74,19144
2
- ChaterJee/__init__.py,sha256=tZmkZY2XbzJ8rHDh8nOmb1W73kPecPv3xcEiCPwkZf4,98
3
- chaterjee-0.5.1.dist-info/METADATA,sha256=XH5FxpdW4bDyCHCbpSBj0XfuKUKiebjoh3L0Dgq_oiQ,6723
4
- chaterjee-0.5.1.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
5
- chaterjee-0.5.1.dist-info/top_level.txt,sha256=Z1UAYoaNybpDiKjqa1yFpti_q0FNECVItb3-9yAh3gM,10
6
- chaterjee-0.5.1.dist-info/RECORD,,