This repository was archived by the owner on Oct 7, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1- import glob
21import json
32import os
43import re
54import time
65from datetime import datetime , timedelta
76from enum import Enum
87from multiprocessing import Event , Queue
8+ from pathlib import Path
99from queue import Empty
1010from threading import RLock , Thread
1111
@@ -91,16 +91,16 @@ def init_jobs(self):
9191
9292 # load personal commands
9393
94- for command_file in glob . glob ( os . path . join ( "personal_commands" , "*.json" ) ):
94+ for command_file in Path ( "personal_commands" ). rglob ( "*.json" ):
9595 try :
9696 with open (command_file ) as personal_command :
97- peronal_cmd = json .loads (personal_command . read () )
98- for command in peronal_cmd :
97+ personal_cmd = json .load (personal_command )
98+ for command in personal_cmd :
9999 if command in self ._commands :
100100 logger .error ("Command {} already exist - skipping" , command )
101101 else :
102102 logger .info ('Loading personal command: {}' , command )
103- self ._commands [command ] = peronal_cmd [command ]
103+ self ._commands [command ] = personal_cmd [command ]
104104 except Exception as e :
105105 logger .error ('Cannot add job {} - Reason: {}' , command_file , e )
106106
You can’t perform that action at this time.
0 commit comments