From 9ee24365c5355531c92a8161e26bbb69e01ba70c Mon Sep 17 00:00:00 2001 From: m455 Date: Tue, 7 Aug 2018 13:40:41 -0400 Subject: [PATCH] added automatic chmod 666 for list --- nicethings | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/nicethings b/nicethings index 43b07e6..cbe08c2 100755 --- a/nicethings +++ b/nicethings @@ -20,18 +20,19 @@ messages = {'list_created': "{} created, try your command again and it should wo 'too_many_args': "sorry, i only accept one argument.\ntry using:\n{} \"your message here\"".format(program_name), 'file_not_found': "{} doesn't exist\ndo you want me to make a {} file right now? (y/n)".format(the_list, the_list)} -def write_to_file(list_file, content): - temp = open(list_file, 'a') +def write_to_file(a_file, content): + temp = open(a_file, 'a') temp.write(content) temp.close() -def create_file(list_file): - open(list_file, 'a').close() +def create_file(a_file): + open(a_file, 'a').close() + os.chmod(the_list, 0o666) print(messages['list_created']) -def show_random_line(list_file): - thefile = open(list_file, 'r').read(1) - temp = open(list_file, 'r') +def show_random_line(a_file): + thefile = open(a_file, 'r').read(1) + temp = open(a_file, 'r') contents = temp.read(1) if not contents: print(messages['list_empty'])