-
Notifications
You must be signed in to change notification settings - Fork 1
/
repo_merger.py
52 lines (45 loc) · 1.57 KB
/
repo_merger.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
import zipfile, os, re
import time, datetime
from pathlib import Path
RejectFilter = ["build.gradle".lower()
,"AlertController.java".lower()
,"AlertDialog.java".lower()
,"ActionMenuItemView.java".lower()
,"BaseMenuPresenter.java".lower()
,"CascadingMenuPopup.java".lower()
,"ExpandedMenuView.java".lower()
,"MenuBuilder.java".lower()
,"MenuItemImpl.java".lower()
,"MenuPopup.java".lower()
,"StandardMenuPopup.java".lower()
,"ActionMenuPresenter.java".lower()
,"ActionMenuView.java".lower()
,"DialogTitle.java".lower()
,"DropDownListView.java".lower()
,"ListPopupWindow.java".lower()
,"Toolbar.java".lower()
,"select_dialog_singlechoice_material_holo.xml".lower()
,"ids.xml".lower()
]
new_repo_dir=r"D:\Code\ODPlayer\new_repo"
old_repo_dir=r"D:\Code\ODPlayer\AxtAppCompat"
for root, dirs, files in os.walk(new_repo_dir):
for name in files:
#print(os.path.join(root, name))
filename = os.path.join(root, name)
targetfile = old_repo_dir+"\\"+filename[len(new_repo_dir):]
#print(targetfile,os.path.isfile(targetfile))
if name.lower() in RejectFilter:
print("rejected : ", filename)
RejectFilter.remove(name.lower())
else:
ParentFolder = os.path.split(targetfile)[0]
COMMAND = "copy /y "+'"'+filename+'"'+" "+'"'+targetfile+'"'
if not os.path.isdir(ParentFolder):
os.makedirs(ParentFolder)
print(0, os.path.isdir(ParentFolder))
os.system(COMMAND)
#for name in dirs:
print()
for left in RejectFilter:
print("left : ", left)