Commit 161a72e3 authored by Minkush Jain's avatar Minkush Jain

Added feature for getting file path from script

parent 44108b81
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os.path
import os, os.path
import psutil
# Ending Thunderbird process
......@@ -15,7 +15,14 @@ for proc in psutil.process_iter():
# Editing Thunderbird's config
def edit_config(username):
save_path = '/home/%s/.thunderbird/p3qbuiz9.default' % username
# finding path
for r, d, f in os.walk("/home/%s/.thunderbird/" % username):
for files in f:
if files == "prefs.js":
file_path = os.path.join(r, files)
# Editing the path
save_path = file_path[0:-9]
name_of_file = 'user.js'
......@@ -23,6 +30,7 @@ def edit_config(username):
file1 = open(completeName, 'w')
# new Preferences
toFile = \
'''user_pref("mail.attach_vcard", true);
user_pref("mail.biff.play_sound", false);
......@@ -40,7 +48,8 @@ def edit_config(username):
if __name__ == '__main__':
print('Program to close Thunderbird application and edit its configuration settings\n')
print('Program to close Thunderbird application\
and edit its configuration settings\n')
username = input("Enter your PC's user name: ")
edit_config(username)
print("\nYour Thunderbird's preferences have been successfully updated!")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment