File tree Expand file tree Collapse file tree 4 files changed +24
-7
lines changed Expand file tree Collapse file tree 4 files changed +24
-7
lines changed Original file line number Diff line number Diff line change 1
- /AppStorage /
1
+ /AppStorage /
2
+ /__pycache__ /
3
+ /links.txt
Original file line number Diff line number Diff line change
1
+ import os
2
+
3
+ def isLinksFileEmpty ():
4
+ file = open ("links.txt" , "r" )
5
+ fileData = file .readlines ()
6
+
7
+ if (len (fileData ) < 1 ):
8
+ return True
9
+ else :
10
+ return False
Original file line number Diff line number Diff line change 1
1
from LinkExtractor import Extract
2
2
from Saver import CheckFolder , WriteData
3
3
from Remover import CheckLinksFile , RemoveLines
4
+ from Checker import isLinksFileEmpty
4
5
5
6
def main ():
6
7
CheckLinksFile ()
7
- fileData = open ("links.txt" , "r" ).readlines ()
8
- CheckFolder ()
9
8
10
- for x in fileData :
11
- data = Extract (x )
12
- WriteData (data )
9
+ if (isLinksFileEmpty ):
10
+ print ("Your links.txt file is empty. Fill it with your desired log lines to proceed." )
11
+ else :
12
+ fileData = open ("links.txt" , "r" ).readlines ()
13
+ CheckFolder ()
13
14
14
- RemoveLines ()
15
+ for x in fileData :
16
+ data = Extract (x )
17
+ WriteData (data )
18
+
19
+ RemoveLines ()
15
20
16
21
main ()
You can’t perform that action at this time.
0 commit comments