Skip to content

Commit

Permalink
helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
fpelliccioni committed Apr 6, 2019
1 parent 5b17087 commit 002dfbf
Showing 1 changed file with 29 additions and 19 deletions.
48 changes: 29 additions & 19 deletions helpers/clone-copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@
PATH = '/Users/fernando/dev/bitprim/secp256k1/src/'
SOURCE_PATH = '/Users/fernando/dev/bitcoin-abc/src/secp256k1/src/'

# result = [os.path.join(dp, f) for dp, dn, filenames in os.walk(PATH) for f in filenames if os.path.splitext(f)[1] == '.txt']
# result = [os.path.join(dp, f) for dp, dn, filenames in os.walk(PATH) for f in filenames]
result1 = [(dp, f) for dp, dn, filenames in os.walk(PATH) for f in filenames]
# # result = [os.path.join(dp, f) for dp, dn, filenames in os.walk(PATH) for f in filenames if os.path.splitext(f)[1] == '.txt']
# # result = [os.path.join(dp, f) for dp, dn, filenames in os.walk(PATH) for f in filenames]
# result1 = [(dp, f) for dp, dn, filenames in os.walk(PATH) for f in filenames]

for dp, f in result1:
x = os.path.join(dp, f)
# for dp, f in result1:
# x = os.path.join(dp, f)

# print(dp)
# print(x)
# print(x[len(PATH):])
# # print(dp)
# # print(x)
# # print(x[len(PATH):])

source_file = os.path.join(SOURCE_PATH, x[len(PATH):])
print(source_file)
# print(os.path.isfile(source_file))
# source_file = os.path.join(SOURCE_PATH, x[len(PATH):])
# print(source_file)
# # print(os.path.isfile(source_file))

# print(x)
# # print(x)

try:
copyfile(source_file, x)
except IOError as identifier:
pass
# try:
# copyfile(source_file, x)
# except IOError as identifier:
# pass

print('------------------------------------------------')

Expand All @@ -43,11 +43,21 @@
print(target_file)
# print(os.path.isfile(source_file))

# print(x)
dir_name, _ = os.path.split(target_file)
print(dir_name)

try:
copyfile(x, target_file)
except IOError as identifier:
os.makedirs(dir_name) #, exist_ok=True)
except OSError as identifier:
pass


# print(x)
copyfile(x, target_file)

# try:
# copyfile(x, target_file)
# except IOError as identifier:
# pass


0 comments on commit 002dfbf

Please sign in to comment.