<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://svn.reviewboard.kde.org/r/6486/">http://svn.reviewboard.kde.org/r/6486/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On February 18th, 2011, 7:28 a.m., <b>Ralf Habacker</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">&gt; __installedDBPrefix

InternalPackageBase is derived from PackageBase, so the one in PackageBase is enough. Because __installedDBPrefix is used in InternalPackageBase is should be named  installedDBPrefix without any prefix. 

&gt; simplify code in PackagerFactory (this code is actually unused but it looks like a plan for the future)

PackagerFactory is used by MultiPackager to instantiate packager backends similiar to MultiSource for Source types 

class MultiPackager():
    def __init__(self, packagerType=None):
        utils.debug( &quot;MultiPackager __init__ %s&quot; %packagerType, 2 )
        self.packagers = PackagerFactory(self, packagerType)

    def createPackage(self):
        result = True
        for packager in self.packagers:
            if not packager.createPackage():
                result = False
        return result

    def make_package(self):
        return self.createPackage()

In ...PackageBase classes normally a single Packager approach is selected 

class CMakePackageBase (PackageBase, MultiSource, CMakeBuildSystem, KDEWinPackager):
    &quot;&quot;&quot;provides a base class for cmake packages from any source&quot;&quot;&quot;
    def __init__(self):
        utils.debug(&quot;CMakePackageBase.__init__ called&quot;, 2)
        PackageBase.__init__(self)
        MultiSource.__init__(self)
        CMakeBuildSystem.__init__(self)
        KDEWinPackager.__init__(self)

The multiple packager approach allows to support more than one packager 

class CMakePackageBase (PackageBase, MultiSource, CMakeBuildSystem, MultiPackager):
    &quot;&quot;&quot;provides a base class for cmake packages from any source&quot;&quot;&quot;
    def __init__(self):
        utils.debug(&quot;CMakePackageBase.__init__ called&quot;, 2)
        PackageBase.__init__(self)
        MultiSource.__init__(self)
        CMakeBuildSystem.__init__(self)
        MultiPackager.__init__(self,[&quot;packagertype1&quot;,&quot;packagertype2&quot;])

(the default packages may be set in the future by a generic option)



otherwise looks good. 
</pre>
 </blockquote>




 <p>On February 18th, 2011, 8:32 a.m., <b>Wolfgang Rohdewald</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">&gt; Because __installedDBPrefix is used in InternalPackageBase is should be named  installedDBPrefix without any prefix. 

because it is only used in a derived class, I renamed it to _installedDBPrefix (only one underscore) being the conventional naming
for protected, I do not see the need to make it public

&gt; MultiPackager.__init__(self,[&quot;packagertype1&quot;,&quot;packagertype2&quot;])

MultiPackager is never instantiated with that list of packagertypes, so that code must currently be unused.
Thank you for your explanation - that is what I actually figured out myself

Looking at it again, I now simplified it further, so you can do

MultiPackager.__init__(self, [KDEWinPackager, CPackPackager]) 

Just pass the classes themselves.

The previous mapping from string to class is not needed and cannot be checked by pylint. Also,
this automatically works for new packagers

</pre>
 </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">&gt; the conventional naming for protected, 

ah okay 

&gt; MultiPackager is never instantiated with that list of packagertypes, so that code must currently be unused.

there are other projects outside kde using MultiPackager, for example http://www.gausz.de uses it for building 7z and inno setup packages. 

&gt; MultiPackager.__init__(self, [KDEWinPackager, CPackPackager]) 

that looks very 

&gt; Also this automatically works for new packagers

very good :-) 


</pre>
<br />








<p>- Ralf</p>


<br />
<p>On February 18th, 2011, 8:36 a.m., Wolfgang Rohdewald wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://svn.reviewboard.kde.orgrb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for kde-windows.</div>
<div>By Wolfgang Rohdewald.</div>


<p style="color: grey;"><i>Updated Feb. 18, 2011, 8:36 a.m.</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">__installedDBPrefix existed identically in PackageBase and InternalPackageBase. Remove it from InternalPackageBase and rename to _installedDBPrefix

rename self.packager to self.packagerExe for consistency

simplify code in PackagerFactory (this code is actually unused but it looks like a plan for the future)

a few other small simplifications around packager code</pre>
  </td>
 </tr>
</table>





<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/trunk/kdesupport/emerge/bin/Package/InternalPackageBase.py <span style="color: grey">(1221360)</span></li>

 <li>/trunk/kdesupport/emerge/bin/Package/PackageBase.py <span style="color: grey">(1221360)</span></li>

 <li>/trunk/kdesupport/emerge/bin/Packager/InnoSetupPackager.py <span style="color: grey">(1221360)</span></li>

 <li>/trunk/kdesupport/emerge/bin/Packager/KDEWinPackager.py <span style="color: grey">(1221360)</span></li>

 <li>/trunk/kdesupport/emerge/bin/Packager/PackagerFactory.py <span style="color: grey">(1221360)</span></li>

 <li>/trunk/kdesupport/emerge/bin/Packager/SevenZipPackager.py <span style="color: grey">(1221360)</span></li>

</ul>

<p><a href="http://svn.reviewboard.kde.org/r/6486/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>