-
Notifications
You must be signed in to change notification settings - Fork 0
/
aslichange.py
53 lines (37 loc) · 1.25 KB
/
aslichange.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 24 01:48:24 2019
@author: vivanksharma
"""
import os
from addfile import addfile
from removefile import removefile
cd = os.getcwd()
path = cd
early_version = []
files = []
def Diff(li1, li2):
return (list(set(li1) - set(li2)))
for root, dirs, filenames in os.walk(path):
for f in filenames:
files.append(os.path.relpath(os.path.join(root, f), path))
for root, dirs, filenames in os.walk(path):
for f in filenames:
early_version.append(os.path.relpath(os.path.join(root, f), path))
while 1:
files = []
for root, dirs, filenames in os.walk(path):
for f in filenames:
files.append(os.path.relpath(os.path.join(root, f), path))
if(len(Diff(early_version,files))>0 or len(Diff(files,early_version))>0):
print(Diff(files,early_version))
print(Diff(early_version,files))
if(len(Diff(files,early_version))>0):
addfile()
if(len(Diff(early_version,files))>0):
removefile()
early_version=[]
for root, dirs, filenames in os.walk(path):
for f in filenames:
early_version.append(os.path.relpath(os.path.join(root, f), path))