<span style="font-family:courier new,monospace">Hello!<br><br>I'm new to FePy, and to the list as well. Got an issue I've been working at for a while - and hoped someone wiser and more experienced could help with.<br>
<br>To start I'm using IronPython Studio (MS Visual Studio 2010), along with WPF for the GUI. The problem I'm having is convincing the UI containing the progress bars, and other messages to update during the process - including closing after the process is completed.<br>
<br>The purpose of the object is to provide for File Sanitization. So if you decide to test the code please be sure you don't delete any files you may want to recover. Or better yet: Delete a copy.<br><br>TIA<br><br>- Damien<br>
<br></span><span style="font-family:courier new,monospace">\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\</span><span style="font-family:courier new,monospace">\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\<br>
</span><span style="font-family:courier new,monospace">/////////////////////////////////////////////////////////////////////</span><span style="font-family:courier new,monospace">//////////////////////////////////////////////////////////////////<br>
</span><span style="font-family:courier new,monospace"></span><span style="font-family:courier new,monospace"></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">>>>>>[ BEGIN FileSanitization.py</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"></span><span style="font-family:courier new,monospace"><br>
</span><span style="font-family:courier new,monospace">\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\</span><span style="font-family:courier new,monospace">\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\<br>
</span><span style="font-family:courier new,monospace">/////////////////////////////////////////////////////////////////////</span><span style="font-family:courier new,monospace">//////////////////////////////////////////////////////////////////<br>
</span><span style="font-family:courier new,monospace"></span><span style="font-family:courier new,monospace"><br><br>import clr, datetime, os, random, sys, traceback, wpf</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">clr.AddReference('System.Windows.Forms')</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">from System.Windows import *</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">from System.Windows.Forms import MessageBox</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">from time import sleep, localtime, strftime</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">class Sanitizer(Window):</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> """ A File Sanitization class providing secure data removal.</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> Methods Available:</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> US Department of Defence</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> Gutmann</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> Pseudo-Random Number</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> RCMP TSSIT OPS11</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> Single Pass 0</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> Single Pass 1</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> """</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> def __init__(self):</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> self.fileCount = 0</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> self.conDict = {}</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> wpf.LoadComponent(self, 'effacor_UIprogressBar.xaml')</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> mapControls(self.Content.Children, self.conDict, False)</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> self.ShowInTaskbar = False</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> def Sanitize(self, dGrid, method):</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> methDict={'DoD':self.sanViaDoD5220_22M, 'Gut':self.sanViaGutmann, 'PRN':self.pseudoRandomNumber, </span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 'RCM':self.sanViaRCMP_TSSIT_OPS11, 'SP0':self.singlePass0, 'SP1':self.singlePass1</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> }</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> self.conDict['Task_Begun'] = 'Task Begun: %s' % (str(localtime()))</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> self.conDict['List_Progress'].Maximum = dGrid.Items.Count</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> self.ShowDialog()</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> # Sanitize the Data</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> for x in range(0, dGrid.Items.Count):</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> # /////</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #self.conDict['File_Counter'].Content = "Processing File %s of %s" % (str(x+1), str(dGrid.Items.Count))</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> # \\\\\</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> try:</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> methDict[method](dGrid.Items[x])</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> os.remove(dGrid.Items[x])</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> except Exception:</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> nbcLock = traceback.format_exc()</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> MessageBox.Show("there were errors:\n%s\n" % (nbcLock), "Problem Occured During Sanitization")</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> self.Close()</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> def spOverwrite(self, fNym, oneZeroRandom):</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> """ Performs a single pass over the data.</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> - If oneZeroRandom is a 1 or 0, it writes that. Otherwise, it randomizes </span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> the output (I use "3" for that).</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> - By nature, function serves as the Single Pass 0, Single Pass 1, and PRNG </span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> algorithms as well (use oneZeroRandom = 3 to use the PRNG algorithm).</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> -----</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> fObj : File Pointer</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> fSiz : File Size</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> oneZeroRandom: Determines the type of pass to be performed. </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 0 = Overwrite file with zeros</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 1 = Overwrite file with ones</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 3 = Overwrite with random data (randomized data actually written </span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> for all values that are not 0 or 1)</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> """</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> fObj = open(fNym, "rb+")</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> fSiz = os.path.getsize(fNym)</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> fObj.seek(0)</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> </span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> for x in range(0, fSiz):</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> if oneZeroRandom in (0,1):</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> fObj.write(chr(oneZeroRandom*255))</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> else:</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> fObj.write(chr(random.randrange(0,255)))</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> </span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> fObj.close()</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> def pseudoRandomNumber(self, fNym):</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #self.conDict['File_Progress'].Maximum = 1</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> # </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> self.spOverwrite(fNym, 3) </span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #self.conDict['File_Progress'].Value = 1</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> def singlePass0(self, fNym):</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #self.conDict['File_Progress'].Maximum = 1</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> self.spOverwrite(fNym, 0) </span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #self.conDict['File_Progress'].Value = 1</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> def singlePass1(self, fNym):</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #self.conDict['File_Progress'].Maximum = 1</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> self.spOverwrite(fNym, 1) </span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #self.conDict['File_Progress'].Value = 1</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> def sanViaDoD5220_22M(self, fNym):</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> """ Performs Department of Defense spec data sanitization as specified in </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> the National Industrial Security Program Operating Manual (NISPOM DoD 5220.22-M).</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> -----</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> fObj : File Pointer</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> fSiz : File Size</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> dOdPat : An array storing the patterns for each sanitization run.</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> """</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> dOdPat = [0,1,3,0,1,0,3]</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> # self.conDict['File_Progress'].Maximum = 7</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> for x in range(0, 6):</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #self.conDict['File_Progress'].Value = x+1</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> spOverwrite(fNym, dOdPat[x])</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> def sanViaRCMP_TSSIT_OPS11(self, fNym):</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> """ Performs RCMP TSSIT OPS-II data sanitization as originally defined in Appendix Ops-II: </span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> Media Sanitation of the Technical Security Standards for Information Technology (TSSIT)</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> document, published by the Royal Canadian Mounted Police (RCMP).</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> -----</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> fObj : File Pointer</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> fSiz : File Size</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> rcmpPat : An array storing the patterns for each sanitization run.</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> """</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> rcmpPat = [1,0,1,0,1,0,3]</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #self.conDict['File_Progress'].Maximum = 7</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> for x in range(0, 6):</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #self.conDict['File_Progress'].Value = x+1</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> spOverwrite(fNym, rcmpPat[x])</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> def sanViaGutmann(self, fNym):</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> """ Performs data sanitization using the Gutmann Method. </span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> Media Sanitation of the Technical Security Standards for Information Technology (TSSIT)</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> document, published by the Royal Canadian Mounted Police (RCMP).</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> -----</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> fObj : File Pointer</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> fSiz : File Size</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> rcmpPat : An array storing the patterns for each sanitization run.</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> """</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> # gPat stores the pre-determined patterns used during the overwrite process used</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> # in the gutmann method.</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> gPat = [[0x55], [0xAA], [0x92,0x49,0x24], [0x49,0x24,0x92], [0x24,0x92,0x49], [0x00], [0x11], [0x22], [0x33]]</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> gPat[len(gPat):] = [[0x44], [0x55], [0x66], [0x77], [0x88], [0x99], [0xAA], [0xBB], [0xCC], [0xDD], [0xEE]]</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> gPat[len(gPat):] = [[0xFF], [0x92,0x49,0x24], [0x49,0x24,0x92], [0x24,0x92,0x49], [0x6D,0xB6,0xDB]]</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> gPat[len(gPat):] = [[0xB6,0xDB,0x6D], [0xDB,0x6D,0xB6]]</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> # Use the data containing the set of 27 pre-determined patterns and determine pass order.</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> # The ORDER those patterns are written in is randomized.</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> x = random.randrange(0,26)</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> gPatOrder = []</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> while len(gPatOrder) < 26:</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> # It is necessary to check to insure that a pattern is not selected twice.</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> # Hence the additional while clause.</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> while x in gPatOrder:</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> x = random.randrange(0,26)</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> gPatOrder[len(gPatOrder):] = [x]</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> fPass = 0</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #self.conDict['File_Progress'].Maximum = 27</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> # Make the initial 4 passes writing over the data</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> # Each pass overwrites the data in the file with random data.</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> # This is the first step in the Gutmann process.</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> for x in range(0, 3):</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> self.spOverwrite(fNym, 3)</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> fPass = fPass + 1</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #self.conDict['File_Progress'].Value = fPass</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> # Make the 27 passes to overwrite the data.</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> # Use the pre-determined, pseudo-random order as determined by gPatOrder.</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> fObj = open(fNym, "rb+")</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> fSiz = os.path.getsize(fNym) </span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> for x in gPatOrder:</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> fObj.seek(0)</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> for y in range(0, fSiz):</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> fObj.write(chr(gPat[x][y%len(gPat[x])]))</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> fPass = fPass + 1</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #self.conDict['File_Progress'].Value = fPass</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> fObj.close()</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> # Make 4 passes writing over the data</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> # Each pass overwrites the data in the file with random data.</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> # This is the final step in the Gutmann process.</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> for x in range(0, 3):</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> self.spOverwrite(fNym, 3)</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> fPass = fPass + 1</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> #self.conDict['File_Progress'].Value = fPass</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">def mapControls(winObj, dict, items):</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> """ Maps the controls found in a WPF object (winObj) and places them into</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> dict for easy reference later.</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> - The items parameter is used during the recursive pass.</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> -----</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> winObj : Object to be mapped.</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> dict : Dictionary in which mappings are stored.</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> items : (Boolean) Specifies whether or not the procedure for iterating </span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> through an items collection should be used.</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> x : Iterator</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> """</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> if items == True:</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> for x in winObj.Items:</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> dict[x.Name] = x</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> if hasattr(x, "Items") and x.Items.Count > 0:</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> mapControls(x, dict, True)</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> else:</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> for x in winObj:</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> if "System.Windows.Controls." in str(x) and hasattr(x,"Name") and x.Name.Length>0:</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> dict[x.Name] = x</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> if hasattr(x, "Items") and x.Items.Count > 0:</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> mapControls(x, dict, True)</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\</span><span style="font-family:courier new,monospace">\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\<br>
</span><span style="font-family:courier new,monospace">/////////////////////////////////////////////////////////////////////</span><span style="font-family:courier new,monospace">//////////////////////////////////////////////////////////////////<br>
</span><span style="font-family:courier new,monospace"></span><span style="font-family:courier new,monospace"></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">>>>>>[ BEGIN effacor_UIprogressBar.xaml</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"></span><span style="font-family:courier new,monospace"><br></span><span style="font-family:courier new,monospace">\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\</span><span style="font-family:courier new,monospace">\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\<br>
</span><span style="font-family:courier new,monospace">/////////////////////////////////////////////////////////////////////</span><span style="font-family:courier new,monospace">//////////////////////////////////////////////////////////////////<br>
</span><span style="font-family:courier new,monospace"></span><span style="font-family:courier new,monospace"></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"><Window xmlns="<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation">http://schemas.microsoft.com/winfx/2006/xaml/presentation</a>"</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> xmlns:x="<a href="http://schemas.microsoft.com/winfx/2006/xaml">http://schemas.microsoft.com/winfx/2006/xaml</a>"</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> Title="Task Progress" Height="180" Width="393" IsManipulationEnabled="True" Topmost="False" WindowStartupLocation="CenterScreen" WindowStyle="SingleBorderWindow" ResizeMode="NoResize"></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> <Grid Height="136"></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> <ProgressBar Name="File_Progress" Height="10" HorizontalAlignment="Left" Margin="12,86,0,0" VerticalAlignment="Top" Width="348" /></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> <ProgressBar Name="List_Progress" Height="10" HorizontalAlignment="Left" Margin="12,52,0,0" VerticalAlignment="Top" Width="348" /></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> <Label Name="Current_File" Height="23" HorizontalAlignment="Left" Margin="12,67,0,0" Content="Progress:" VerticalAlignment="Top" FontFamily="Corbel" FontSize="12" Background="#00000000" BorderBrush="#00000000" /></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> <Label Name="File_Counter" Height="23" HorizontalAlignment="Left" Margin="12,33,0,0" Content="Processing File x of y ..." VerticalAlignment="Top" FontFamily="Corbel" FontSize="12" IsEnabled="True" Background="#00000000" BorderBrush="#00000000" /></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> <Label Name="Task_Begun" Height="23" HorizontalAlignment="Left" Margin="180,0,0,0" Content="Task Begun:" VerticalAlignment="Top" Width="180" FontFamily="Corbel" FontSize="12" Background="#00000000" BorderBrush="#00000000" /></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> </Grid></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"></Window></span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace">