{"id":235,"date":"2009-01-01T09:19:00","date_gmt":"2009-01-01T09:19:00","guid":{"rendered":"http:\/\/www.kurianos.com\/wordpress\/?p=235"},"modified":"2010-12-23T03:38:23","modified_gmt":"2010-12-23T03:38:23","slug":"vsfileedit","status":"publish","type":"post","link":"https:\/\/www.kurianos.com\/wordpress\/?p=235","title":{"rendered":"..:: vsFileEdit ::.."},"content":{"rendered":"<p><strong>\u0d12\u0d30\u0d41 python \u0d38\u0d4d\u0d15\u0d4d\u0d30\u0d3f\u0d2a\u0d4d\u0d31\u0d4d\u0d31\u0d4d  <\/strong><\/p>\n<pre><font color=\"#cc0000\">#\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br \/>#\/\/    Script Name :    vsFileEdit.py                                                                                                                               \/\/    <br \/>#\/\/                                                                                                                                                                                 \/\/<br \/>#\/\/    Script Type    :    Remove Visual Studio Projects from the startup page                                                        \/\/<br \/>#\/\/                                                                                                                                                                              \/\/<br \/>#\/\/    Author           :    Kurian O S(Sandhu)                                                                                                                        \/\/<br \/>#\/\/                                                                                                                                                                              \/\/<br \/>#\/\/    Date                :    01\/01\/2009                                                                                                                                        \/\/<br \/>#\/\/                                                                                                                                                                              \/\/<br \/>#\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br \/>  <br \/>#module imports<\/font><br \/><font color=\"#0000b3\">import<\/font> <font color=\"#68086f\">os<\/font><br \/><font color=\"#0000b3\">import<\/font> _winreg as wreg<br \/><font color=\"#0000b3\">import<\/font> wx<br \/>  <br \/><font color=\"#cc0000\">#class starting here<\/font><br \/><font color=\"#0000b3\">class<\/font> ClsVsRemove(wx.Frame):<br \/>    <font color=\"#666666\">'''This module is based on Visual Studio 2008 if you want to use 2005 or other versions please change<br \/>    the  9.0 to like 8.0 or like that'''<\/font><br \/>    <font color=\"#cc0000\">#main global vars<\/font><br \/>    myCurSlect=<font color=\"#666666\">\"\"<\/font><br \/>    putCurI=0<br \/>    parentUILay={<font color=\"#666666\">'frameLay'<\/font>:None}<br \/>    regVsHoldLoc = wreg.OpenKey(wreg.HKEY_CURRENT_USER,r<font color=\"#666666\">\"Software\\Microsoft\\VisualStudio\\9.0\\ProjectMRUList\"<\/font>,0, wreg.KEY_ALL_ACCESS)<br \/>    <font color=\"#cc0000\">#main int for wx layout<\/font><br \/>    <font color=\"#0000b3\">def<\/font> __init__(self):<br \/>        <font color=\"#666666\">'''Here we are creating the main WX layout for the window<br \/>        To Display the reg values from visual studio'''<\/font><br \/>        self.parentUILay[<font color=\"#666666\">'frameLay'<\/font>]=wx.Frame.__init__(self, <font color=\"#0000b3\">id<\/font>=wx.ID_ANY, name=<font color=\"#666666\">''<\/font>, parent=None,pos=wx.Point(358, 184),style=wx.CLOSE_BOX|wx.SYSTEM_MENU | wx.CAPTION | wx.CLIP_CHILDREN, title=u<font color=\"#666666\">'..:: VS File Remover ::..'<\/font>)<br \/>        self.SetClientSize(wx.Size(291, 250))<br \/>        self.listbox = wx.ListBox(self, wx.ID_ANY, choices=[],style=wx.LB_SINGLE,size=wx.Size(650,200))<br \/>        self.removeBut = wx.Button(self, wx.ID_ANY, <font color=\"#666666\">\"Remove Selected\"<\/font>)<br \/>        self.removeAllBut = wx.Button(self, wx.ID_ANY, <font color=\"#666666\">\"Remove All\"<\/font>)<br \/>        sizer = wx.GridBagSizer(vgap=5, hgap=5)<br \/>        sizer.Add(self.listbox, pos=(0, 0),span=(6, 2),flag=wx.ALL|wx.EXPAND, border=5)<br \/>        sizer.Add(self.removeBut, pos=(7, 1), flag=wx.ALL, border=5)<br \/>        sizer.Add(self.removeAllBut, pos=(7, 0), flag=wx.ALL, border=5)<br \/>        self.SetSizer(sizer)<br \/>        self.listbox.Bind(wx.EVT_LISTBOX, self.listSlection)<br \/>        self.removeBut.Bind(wx.EVT_BUTTON, self.removeThisTag)<br \/>        self.removeAllBut.Bind(wx.EVT_BUTTON, self.removeAllRegKey)<br \/>        self.Fit()<br \/>        self.regLoadHere()<br \/>    <br \/>    <font color=\"#cc0000\">#Registry value eading function<\/font><br \/>    <font color=\"#0000b3\">def<\/font> regLoadHere(self):<br \/>        <font color=\"#666666\">'''Here we are reading the Registry values and appening to the window<br \/>        from WX ....'''<\/font><br \/>        <font color=\"#0000b3\">for<\/font> self.putCurI <font color=\"#0000b3\">in<\/font> <font color=\"#0000b3\">range<\/font>(1024):<br \/>            <font color=\"#0000b3\">try<\/font>:<br \/>                n,v,t = wreg.EnumValue(self.regVsHoldLoc,self.putCurI)<br \/>                self.listbox.Append(n+<font color=\"#666666\">\"  \"<\/font> +v)<br \/>            <font color=\"#0000b3\">except<\/font> EnvironmentError:<br \/>                <font color=\"#0000b3\">break<\/font><br \/>  <br \/>    <font color=\"#cc0000\">#transfering selection to a global var<\/font><br \/>    <font color=\"#0000b3\">def<\/font> listSlection(self,event):<br \/>        self.myCurSlect=<font color=\"#666666\">\"\"<\/font><br \/>        self.myCurSlect=self.listbox.GetStringSelection()<br \/>        self.myCurSlect=self.myCurSlect+<font color=\"#666666\">\" %s\"<\/font>%+self.listbox.GetSelection()<br \/>        <br \/>    <font color=\"#cc0000\">#main function for remove a single selection<\/font><br \/>    <font color=\"#0000b3\">def<\/font> removeThisTag(self,event):<br \/>        <font color=\"#666666\">'''This module will remove only the selected value from the visual studio<br \/>        And iof the selection is wrong it will through error '''<\/font><br \/>        getValuHr=self.myCurSlect.split(<font color=\"#666666\">\" \"<\/font>)<br \/>        <font color=\"#0000b3\">if<\/font> getValuHr[0] == <font color=\"#666666\">\"\"<\/font>:<br \/>            <font color=\"#0000b3\">raise<\/font> EnvironmentError, <font color=\"#666666\">'Select a File Which you want to remove !!!'<\/font><br \/>        <font color=\"#0000b3\">else<\/font>:<br \/>            <font color=\"#0000b3\">try<\/font>:<br \/>                wreg.DeleteValue(self.regVsHoldLoc, getValuHr[0])<br \/>                dlg = wx.MessageDialog(self, <font color=\"#666666\">'Selected File Information is Removed !!!'<\/font>+getValuHr[1],<font color=\"#666666\">'Info !!!'<\/font>,wx.OK | wx.ICON_INFORMATION)<br \/>                dlg.ShowModal()<br \/>                dlg.Destroy()<br \/>                <font color=\"#0000b3\">for<\/font> getVal <font color=\"#0000b3\">in<\/font> <font color=\"#0000b3\">range<\/font>(<font color=\"#0000b3\">int<\/font>(getValuHr[3])+1 , self.putCurI):<br \/>                    newContVal=getVal+1<br \/>                    oldKeyVal=<font color=\"#666666\">'File%s'<\/font>%+newContVal<br \/>                    neKeyName=<font color=\"#666666\">'File%s'<\/font>%getVal<br \/>                    getOldKeyVal=wreg.QueryValueEx(self.regVsHoldLoc, oldKeyVal)<br \/>                    wreg.DeleteValue(self.regVsHoldLoc, oldKeyVal)<br \/>                    wreg.SetValueEx(self.regVsHoldLoc,neKeyName,0,wreg.REG_EXPAND_SZ,getOldKeyVal[0]) <br \/>                self.Destroy()<br \/>                ClsVsRemove().Show()<br \/>                app.MainLoop()<br \/>            <font color=\"#0000b3\">except<\/font> EnvironmentError, e:<br \/>                <font color=\"#0000b3\">raise<\/font> EnvironmentError, e<br \/>    <br \/>    <font color=\"#cc0000\">#remove all function call here<\/font><br \/>    <font color=\"#0000b3\">def<\/font> removeAllRegKey(self,event):<br \/>        <font color=\"#666666\">'''This module will remove all the values under tha maain key from visual studio'''<\/font><br \/>        dlg = wx.MessageDialog(self, <font color=\"#666666\">'All File information for the startup will be removed !!!\\nDo You Want to do this ???'<\/font>,<font color=\"#666666\">'Info !!!'<\/font>,style=wx.YES|wx.NO|wx.CANCEL | wx.ICON_INFORMATION)<br \/>        <font color=\"#0000b3\">if<\/font> dlg.ShowModal()==wx.ID_YES:<br \/>            dlg.Destroy()<br \/>            <font color=\"#0000b3\">for<\/font> getVal <font color=\"#0000b3\">in<\/font> <font color=\"#0000b3\">range<\/font>(0 , self.putCurI):<br \/>                newContVal=getVal+1<br \/>                oldKeyVal=<font color=\"#666666\">'File%s'<\/font>%+newContVal<br \/>                getOldKeyVal=wreg.QueryValueEx(self.regVsHoldLoc, oldKeyVal)<br \/>                wreg.DeleteValue(self.regVsHoldLoc, oldKeyVal)<br \/>            dlgConf = wx.MessageDialog(self, <font color=\"#666666\">'All File information removed From Startup'<\/font>,<font color=\"#666666\">'Info !!!'<\/font>,style=wx.OK | wx.ICON_INFORMATION)<br \/>            dlgConf.ShowModal()<br \/>            dlgConf.Destroy()<br \/>            self.Destroy()<br \/>            ClsVsRemove().Show()<br \/>            app.MainLoop()<br \/>        <font color=\"#0000b3\">else<\/font>:<br \/>            <font color=\"#0000b3\">print<\/font> <font color=\"#666666\">\"Exited without any changes !!!\"<\/font><br \/>            <br \/><font color=\"#cc0000\">#starting wx apps with the reg value reader<\/font><br \/><font color=\"#0000b3\">if<\/font> <font color=\"#68086f\">__name__<\/font> == <font color=\"#666666\">'__main__'<\/font>:<br \/>    app = wx.App(0)<br \/>    ClsVsRemove().Show()<br \/>    app.MainLoop()<br \/><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0d12\u0d30\u0d41 python \u0d38\u0d4d\u0d15\u0d4d\u0d30\u0d3f\u0d2a\u0d4d\u0d31\u0d4d\u0d31\u0d4d #\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/#\/\/ Script Name : vsFileEdit.py \/\/ #\/\/ \/\/#\/\/ Script Type : Remove Visual Studio Projects from the startup page \/\/#\/\/ \/\/#\/\/ Author : Kurian O S(Sandhu) \/\/#\/\/ \/\/#\/\/ Date : 01\/01\/2009 \/\/#\/\/ \/\/#\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ #module importsimport osimport _winreg as wregimport wx #class starting hereclass ClsVsRemove(wx.Frame): &#8221;&#8217;This module is based on Visual Studio 2008 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[11],"tags":[],"class_list":["post-235","post","type-post","status-publish","format-standard","hentry","category-maya"],"_links":{"self":[{"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=235"}],"version-history":[{"count":1,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/235\/revisions"}],"predecessor-version":[{"id":427,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/235\/revisions\/427"}],"wp:attachment":[{"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}