Skip to content

Commit

Permalink
Nawab: Add argument to input path to directory to store log files
Browse files Browse the repository at this point in the history
  • Loading branch information
ananthanandanan authored and Aniketh01 committed May 13, 2020
1 parent 19484f5 commit ad76f57
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nawab.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def main():
parser.add_argument("-t", "--tg_bot", help="Doesn't retweet all automatically, can manually retweet through telegram bot",
action='store_true', required=False)
parser.add_argument("-b", "--blacklist",type=list, required=False, help="Blacklist the given username")
parser.add_argument("-p", "--path", type=str, required=False,
help="Path where the log files be stored. Note to create directory in that path beforehand.")
parser.add_argument('-d', '--default', action="store_const", const=30)
parser.add_argument('-V', '--verbose',action="store_const", const=20)
parser.add_argument('-s', '--silent', action="store_const", const=50)
Expand Down Expand Up @@ -95,8 +97,10 @@ def main():
blist = pd.DataFrame({'Blacklist': names})
concats = pd.concat([data,blist])
concats.to_csv('data.csv', index=False)
## if new path is passed then set new default path
if args['path']:
default_dir = args['path']


u_id = pwd.getpwuid(os.getuid()).pw_name

ownership_command = "sudo chown %s: %s" % (u_id, default_dir)
Expand Down

0 comments on commit ad76f57

Please sign in to comment.