<span style="font-family:courier new,monospace">Hello!<br><br>I&#39;m new to FePy, and to the list as well. Got an issue I&#39;ve been working at for a while - and hoped someone wiser and more experienced could help with.<br>
<br>To start I&#39;m using IronPython Studio (MS Visual Studio 2010), along with WPF for the GUI. The problem I&#39;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&#39;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">&gt;&gt;&gt;&gt;&gt;[ 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(&#39;System.Windows.Forms&#39;)</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">    &quot;&quot;&quot; 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">    &quot;&quot;&quot;</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, &#39;effacor_UIprogressBar.xaml&#39;)</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={&#39;DoD&#39;:self.sanViaDoD5220_22M, &#39;Gut&#39;:self.sanViaGutmann, &#39;PRN&#39;:self.pseudoRandomNumber, </span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">                  &#39;RCM&#39;:self.sanViaRCMP_TSSIT_OPS11, &#39;SP0&#39;:self.singlePass0, &#39;SP1&#39;: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[&#39;Task_Begun&#39;] = &#39;Task Begun: %s&#39; % (str(localtime()))</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">        self.conDict[&#39;List_Progress&#39;].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[&#39;File_Counter&#39;].Content = &quot;Processing File %s of %s&quot; % (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(&quot;there were errors:\n%s\n&quot; % (nbcLock), &quot;Problem Occured During Sanitization&quot;)</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">        &quot;&quot;&quot; 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 &quot;3&quot; 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">        &quot;&quot;&quot;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">        fObj = open(fNym, &quot;rb+&quot;)</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[&#39;File_Progress&#39;].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[&#39;File_Progress&#39;].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[&#39;File_Progress&#39;].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[&#39;File_Progress&#39;].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[&#39;File_Progress&#39;].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[&#39;File_Progress&#39;].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">        &quot;&quot;&quot; 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">        &quot;&quot;&quot;</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[&#39;File_Progress&#39;].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[&#39;File_Progress&#39;].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">        &quot;&quot;&quot; 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">        &quot;&quot;&quot;</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[&#39;File_Progress&#39;].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[&#39;File_Progress&#39;].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">        &quot;&quot;&quot; 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">        &quot;&quot;&quot;</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) &lt; 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[&#39;File_Progress&#39;].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[&#39;File_Progress&#39;].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, &quot;rb+&quot;)</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[&#39;File_Progress&#39;].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[&#39;File_Progress&#39;].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">    &quot;&quot;&quot; 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">    &quot;&quot;&quot;</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, &quot;Items&quot;) and x.Items.Count &gt; 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 &quot;System.Windows.Controls.&quot; in str(x) and hasattr(x,&quot;Name&quot;) and x.Name.Length&gt;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, &quot;Items&quot;) and x.Items.Count &gt; 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">&gt;&gt;&gt;&gt;&gt;[ 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">&lt;Window xmlns=&quot;<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation">http://schemas.microsoft.com/winfx/2006/xaml/presentation</a>&quot;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">        xmlns:x=&quot;<a href="http://schemas.microsoft.com/winfx/2006/xaml">http://schemas.microsoft.com/winfx/2006/xaml</a>&quot;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">        Title=&quot;Task Progress&quot; Height=&quot;180&quot; Width=&quot;393&quot; IsManipulationEnabled=&quot;True&quot; Topmost=&quot;False&quot; WindowStartupLocation=&quot;CenterScreen&quot; WindowStyle=&quot;SingleBorderWindow&quot; ResizeMode=&quot;NoResize&quot;&gt;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">    &lt;Grid   Height=&quot;136&quot;&gt;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">        &lt;ProgressBar Name=&quot;File_Progress&quot; Height=&quot;10&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;12,86,0,0&quot; VerticalAlignment=&quot;Top&quot; Width=&quot;348&quot; /&gt;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">        &lt;ProgressBar Name=&quot;List_Progress&quot; Height=&quot;10&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;12,52,0,0&quot; VerticalAlignment=&quot;Top&quot; Width=&quot;348&quot; /&gt;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">        &lt;Label Name=&quot;Current_File&quot; Height=&quot;23&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;12,67,0,0&quot; Content=&quot;Progress:&quot; VerticalAlignment=&quot;Top&quot; FontFamily=&quot;Corbel&quot; FontSize=&quot;12&quot; Background=&quot;#00000000&quot; BorderBrush=&quot;#00000000&quot; /&gt;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">        &lt;Label Name=&quot;File_Counter&quot; Height=&quot;23&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;12,33,0,0&quot; Content=&quot;Processing File x of y ...&quot; VerticalAlignment=&quot;Top&quot; FontFamily=&quot;Corbel&quot; FontSize=&quot;12&quot; IsEnabled=&quot;True&quot; Background=&quot;#00000000&quot; BorderBrush=&quot;#00000000&quot; /&gt;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">        &lt;Label Name=&quot;Task_Begun&quot; Height=&quot;23&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;180,0,0,0&quot; Content=&quot;Task Begun:&quot; VerticalAlignment=&quot;Top&quot; Width=&quot;180&quot; FontFamily=&quot;Corbel&quot; FontSize=&quot;12&quot; Background=&quot;#00000000&quot; BorderBrush=&quot;#00000000&quot; /&gt;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">    &lt;/Grid&gt;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">&lt;/Window&gt;</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace">