Skip to content

Commit ba74b0b

Browse files
committed
Properly add comments in functions PEP8 compatible
Add docstrings for each method used in the script, according to the PEP8 guide: http://pep8.org/#documentation-strings Signed-off-by: Daniel Andrei Minca <mandrei17@gmail.com>
1 parent 65a96c3 commit ba74b0b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

archiver.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,26 @@
88
# get current date
99
current_date = strftime("%Y-%m-%d", gmtime())
1010

11-
# find files and store in array
1211
def find_all(name, path):
12+
"""Return list of paths
13+
14+
Traverse directory until reaches the file that's being searched,
15+
after file is found, return the full path to file in a list.
16+
"""
1317
result = []
1418
for root, dirs, files in os.walk(path):
1519
if name in files:
1620
result.append(os.path.join(root, name))
1721
return result
1822

1923
def main():
24+
"""Create archive from Thunderbird filters
25+
26+
After searching for the filename and returning its fullpath in a list,
27+
loop through the list and generate .tar.gz archive from fullpath.
28+
29+
The archive name follows UNIX time pattern: YYYY-m-d.tar.gz
30+
"""
2031
filename = 'msgFilterRules.dat'
2132
path = os.getenv("HOME") + '/.thunderbird'
2233
output = os.getenv("HOME") + '/Dropbox/Apps/PersonalThunderbirdFiltersBackup/'

0 commit comments

Comments
 (0)