ChaterJee 0.4.9__tar.gz → 0.5.1__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.
@@ -380,6 +380,7 @@ class ChatLogs:
380
380
  return 1
381
381
 
382
382
  async def runjob(self, update: Update, context: ContextTypes.DEFAULT_TYPE):
383
+ self.smsID.append(update.message.message_id)
383
384
  cmd = f"./{self.runexe}"
384
385
  try:
385
386
  os.popen('%s'%(cmd))#.read()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ChaterJee
3
- Version: 0.4.9
3
+ Version: 0.5.1
4
4
  Summary: Communicate your project updates via Telegram Bot!
5
5
  Author: Pallab Dutta
6
6
  Author-email: pallab9997@gmail.com
@@ -132,8 +132,33 @@ stdout_dir=$(jq -r '.LOGDIR' "$hyparam_file")
132
132
  # Create log directory
133
133
  mkdir -p "$stdout_dir"
134
134
 
135
+ # Backup the hyperparam file for reference
136
+ cp "$hyparam_file" "$stdout_dir/$hyparam_file"
137
+
135
138
  # Run the Python script with redirected logs
136
139
  nohup python script.py --hyprm "$hyparam_file" > "$stdout_dir/$stdout_log" 2> "$stdout_dir/error.log" &
140
+
141
+ # Save the PID of the background process
142
+ echo $! > "$stdout_dir/job.pid"
143
+ ```
144
+
145
+ Also, make a `kill_run.sh` file to kill this job in case you need to.
146
+
147
+ `kill_run.sh`
148
+ ```bash
149
+ #!/bin/bash
150
+ stdout_dir=$(jq -r '.LOGDIR' hyperparams.json)
151
+
152
+ # Check if the PID file exists
153
+ pid_file="$stdout_dir/job.pid"
154
+
155
+ if [ -f "$pid_file" ]; then
156
+ pid=$(cat "$pid_file")
157
+ echo "Killing process with PID $pid"
158
+ kill -9 "$pid" && echo "Process killed." || echo "Failed to kill process."
159
+ else
160
+ echo "No PID file found. Is the process running?"
161
+ fi
137
162
  ```
138
163
 
139
164
  Next step is to receive updates on your projects.
@@ -161,6 +186,9 @@ Run the above script in a separate terminal session to start interacting with yo
161
186
 
162
187
  At this stage the following 4 commands work:
163
188
  - `/start` : Starts the conversation with the BOT.
189
+ - `/run` : Runs the job (current directory).
190
+ - `/kill` : Kills the job once you allow (current directory).
164
191
  - `/jobs` : List the jobs as Keyboard button options.
165
192
  - `/clear` : Clears the chat history once you allow.
166
- - `/edit file.json` : Let you edit and save the JSON file by the webapp Editor Babu.
193
+ - `/edit` : Let you choose and edit a JSON file (from current directory) by the webapp Editor Babu.
194
+ - `/edit file.json` : Let you edit and save the JSON file (from any directory) by the webapp Editor Babu.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ChaterJee
3
- Version: 0.4.9
3
+ Version: 0.5.1
4
4
  Summary: Communicate your project updates via Telegram Bot!
5
5
  Author: Pallab Dutta
6
6
  Author-email: pallab9997@gmail.com
@@ -132,8 +132,33 @@ stdout_dir=$(jq -r '.LOGDIR' "$hyparam_file")
132
132
  # Create log directory
133
133
  mkdir -p "$stdout_dir"
134
134
 
135
+ # Backup the hyperparam file for reference
136
+ cp "$hyparam_file" "$stdout_dir/$hyparam_file"
137
+
135
138
  # Run the Python script with redirected logs
136
139
  nohup python script.py --hyprm "$hyparam_file" > "$stdout_dir/$stdout_log" 2> "$stdout_dir/error.log" &
140
+
141
+ # Save the PID of the background process
142
+ echo $! > "$stdout_dir/job.pid"
143
+ ```
144
+
145
+ Also, make a `kill_run.sh` file to kill this job in case you need to.
146
+
147
+ `kill_run.sh`
148
+ ```bash
149
+ #!/bin/bash
150
+ stdout_dir=$(jq -r '.LOGDIR' hyperparams.json)
151
+
152
+ # Check if the PID file exists
153
+ pid_file="$stdout_dir/job.pid"
154
+
155
+ if [ -f "$pid_file" ]; then
156
+ pid=$(cat "$pid_file")
157
+ echo "Killing process with PID $pid"
158
+ kill -9 "$pid" && echo "Process killed." || echo "Failed to kill process."
159
+ else
160
+ echo "No PID file found. Is the process running?"
161
+ fi
137
162
  ```
138
163
 
139
164
  Next step is to receive updates on your projects.
@@ -161,6 +186,9 @@ Run the above script in a separate terminal session to start interacting with yo
161
186
 
162
187
  At this stage the following 4 commands work:
163
188
  - `/start` : Starts the conversation with the BOT.
189
+ - `/run` : Runs the job (current directory).
190
+ - `/kill` : Kills the job once you allow (current directory).
164
191
  - `/jobs` : List the jobs as Keyboard button options.
165
192
  - `/clear` : Clears the chat history once you allow.
166
- - `/edit file.json` : Let you edit and save the JSON file by the webapp Editor Babu.
193
+ - `/edit` : Let you choose and edit a JSON file (from current directory) by the webapp Editor Babu.
194
+ - `/edit file.json` : Let you edit and save the JSON file (from any directory) by the webapp Editor Babu.
@@ -122,8 +122,33 @@ stdout_dir=$(jq -r '.LOGDIR' "$hyparam_file")
122
122
  # Create log directory
123
123
  mkdir -p "$stdout_dir"
124
124
 
125
+ # Backup the hyperparam file for reference
126
+ cp "$hyparam_file" "$stdout_dir/$hyparam_file"
127
+
125
128
  # Run the Python script with redirected logs
126
129
  nohup python script.py --hyprm "$hyparam_file" > "$stdout_dir/$stdout_log" 2> "$stdout_dir/error.log" &
130
+
131
+ # Save the PID of the background process
132
+ echo $! > "$stdout_dir/job.pid"
133
+ ```
134
+
135
+ Also, make a `kill_run.sh` file to kill this job in case you need to.
136
+
137
+ `kill_run.sh`
138
+ ```bash
139
+ #!/bin/bash
140
+ stdout_dir=$(jq -r '.LOGDIR' hyperparams.json)
141
+
142
+ # Check if the PID file exists
143
+ pid_file="$stdout_dir/job.pid"
144
+
145
+ if [ -f "$pid_file" ]; then
146
+ pid=$(cat "$pid_file")
147
+ echo "Killing process with PID $pid"
148
+ kill -9 "$pid" && echo "Process killed." || echo "Failed to kill process."
149
+ else
150
+ echo "No PID file found. Is the process running?"
151
+ fi
127
152
  ```
128
153
 
129
154
  Next step is to receive updates on your projects.
@@ -151,6 +176,9 @@ Run the above script in a separate terminal session to start interacting with yo
151
176
 
152
177
  At this stage the following 4 commands work:
153
178
  - `/start` : Starts the conversation with the BOT.
179
+ - `/run` : Runs the job (current directory).
180
+ - `/kill` : Kills the job once you allow (current directory).
154
181
  - `/jobs` : List the jobs as Keyboard button options.
155
182
  - `/clear` : Clears the chat history once you allow.
156
- - `/edit file.json` : Let you edit and save the JSON file by the webapp Editor Babu.
183
+ - `/edit` : Let you choose and edit a JSON file (from current directory) by the webapp Editor Babu.
184
+ - `/edit file.json` : Let you edit and save the JSON file (from any directory) by the webapp Editor Babu.
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='ChaterJee',
5
- version='0.4.9',
5
+ version='0.5.1',
6
6
  packages=find_packages(),
7
7
  install_requires=[
8
8
  'python-telegram-bot==20.7',
File without changes