From 88e1db70f26d79fafe7d5d3a20c174d43386ab79 Mon Sep 17 00:00:00 2001 From: Jan Lerking Date: Fri, 9 Feb 2018 22:41:33 +0100 Subject: [PATCH] Added function process_files --- __pycache__/h2inc.cpython-35.pyc | Bin 1577 -> 1546 bytes __pycache__/h2inc_gui.cpython-35.pyc | Bin 6236 -> 6281 bytes __pycache__/h2inc_parser.cpython-35.pyc | Bin 4454 -> 4454 bytes h2inc.py | 31 +++++++++++++++--------- h2inc_gui.py | 5 ++-- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/__pycache__/h2inc.cpython-35.pyc b/__pycache__/h2inc.cpython-35.pyc index d2358b340aa1d9174aee07bd161a205cb0491b4d..6a5035fad489a30858d08292becaddfb55e65dae 100644 GIT binary patch delta 714 zcmZ9J&u-H|5XNWLf0CFwG))>>E(NKoWC@Tefg+WP3lT>yJp>^tWa3S0H));SEee&> zi1x+-sq&cz;4ydtkhmbf0nfmN83#&)t^Ia(_S@0uH=mb2EO~9;_rA2wU)HKu-uK52 z06e9o-;zWKQ-nzj1|UJm04@=_`!C>?1ycc2QX3}EAhRj^Bwxd=N9=SUaUpZqe1Omi zZ5ZE!-nb3D3}G*@pDU!|XX3%(PY!}gKE|!OordPHs6??k4o5Qogge;Gf8cJrP96}h z*gzjw(Zjn!tpZ$qy@eNfS6t-ZM6|p@7S+6#R^GLe89ywXRK>@p@CGNtNUCA1P2eh@ zoi|yQSsHAt>C-oJQ{fmnN(YPe*tJG-hn8-UfW3h(HB`qY?H>INt90}Q-_mE#NUm{y zqyys=FnP~7yZi5$pCPIigGxjh6FoYXocW6Ke~*`B0LTRF8v9SQPVdl^w3Et0PG`W` zS#=?Y^fD6Ap$5i2^dg`^So1+BZZfE;+q4yyHmay7nGVCgEUW`*)H>yr%W{JquAC4= zT~tTmk)&zqz%F^x=%hB3P$hR9bp8Wa_^CSSORZlI;-S>rR7{t%wHV|>LfOU!s?B`n b>;>FRS%_ynXRkIn`Zwe!n`Mh~w`CRdv)vEu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nO)m@)5*teDt3jd kUpO9L(O;Z4U)6;|bF8gqT1{^h8fn{_+)waiG|SWcFB}Yr;s5{u diff --git a/__pycache__/h2inc_parser.cpython-35.pyc b/__pycache__/h2inc_parser.cpython-35.pyc index 076292d7a007937f71a20a982a44a21822b3b5ce..bf634294fe3fdc26452bd0efed7a8d4d78a1cf06 100644 GIT binary patch delta 15 WcmaE+^h}9OjF*?|xWGoX1VI2NjRa5t delta 15 WcmaE+^h}9OjF*?IopmEyf*=4T)&vCr diff --git a/h2inc.py b/h2inc.py index 2309a52..658bbd8 100644 --- a/h2inc.py +++ b/h2inc.py @@ -26,7 +26,7 @@ def sourcedir_filecnt(sourcedir): if file.lower().endswith('.h'): cnt += 1 filelist += [file] - print(filelist) + #print(filelist) return cnt def sourcedir_foldercnt(sourcedir): @@ -42,16 +42,25 @@ def sourcedir_foldercnt(sourcedir): cnt = cnt+1 print(folderName) folderlist += [folderName] - print(folderlist) + #print(folderlist) + #print(len(folderlist)) return cnt def process_files(sourcedir, destdir): - WorkPath = os.path.dirname(sourcedir) - print(WorkPath) - incpath = destdir - print(incpath) - if not os.path.exists(incpath): - os.makedirs(incpath) - pattern = '.h' - inputfile = 'gtkaboutdialog.h' - filehandle = open(WorkPath+'/'+inputfile, 'r') \ No newline at end of file + global folderlist + global filelist + cnt = 0 + for f in folderlist: + folderlist[cnt] = str(f).replace(str(sourcedir.get()), str(destdir.get())) + print(folderlist[cnt]) + if not os.path.exists(folderlist[cnt]): + os.makedirs(folderlist[cnt]) + cnt += 1 + #WorkPath = os.path.dirname(sourcedir) + #print(WorkPath) + #incpath = destdir + #print(incpath) + + #pattern = '.h' + #inputfile = 'gtkaboutdialog.h' + #filehandle = open(WorkPath+'/'+inputfile, 'r') \ No newline at end of file diff --git a/h2inc_gui.py b/h2inc_gui.py index 8cdafef..695d0c3 100644 --- a/h2inc_gui.py +++ b/h2inc_gui.py @@ -15,7 +15,7 @@ import os from os.path import expanduser import platform import sys -from h2inc import sourcedir_filecnt, sourcedir_foldercnt +from h2inc import sourcedir_filecnt, sourcedir_foldercnt, process_files class h2incGUI: def __init__(self, master): @@ -137,7 +137,7 @@ class h2incGUI: doinc = addinc.get() dest = destdir.get() if doinc == 'yes': - dest = dest+'/include/' + dest = dest+'/include' print(os.path.exists(os.path.dirname(dest))) if not os.path.exists(os.path.dirname(dest)): try: @@ -147,6 +147,7 @@ class h2incGUI: raise destdir.set(dest) print ('Destination directory: ', destdir.get()) + process_files(sourcedir, destdir) root = Tk()