[CMF-checkins] CVS: CMF/CMFSetup/www - sutCompare.zpt:1.1

Tres Seaver tseaver at zope.com
Tue Jul 20 12:13:53 EDT 2004


Update of /cvs-repository/CMF/CMFSetup/www
In directory cvs.zope.org:/tmp/cvs-serv27771/www

Added Files:
	sutCompare.zpt 
Log Message:


  - interfaces.py:

    o Modify API for 'compareConfigurations', which should now be passed
      IimportContext implementations for lhs / rhs arguments.

  - context.py:

    o Rename ImportContext -> DirectoryImportContext.

    o Rename ExportContext -> ExrectoryImportContext.

    o Fix glitch in DirectoryImportContext which broke 'listDirectory'
      for the profile root.

    o Use 'read()' instead of 'manage_FTPget' to fetch content for objects
      in SnapshotImportContexts;  note that this may not be general enough
      for all cases (but it should work for PythonScripts, and *does* work
      for PageTemplates).

  - tool/py:

    o Add UI for displaying / downloading diffs of configurations (profiles
      and snapshots).


=== Added File CMF/CMFSetup/www/sutCompare.zpt ===
<h1 tal:replace="structure here/manage_page_header">PAGE HEADER</h1>
<h1 tal:replace="structure here/manage_tabs">TABS</h1>

<style type="text/css">
.file-to-dir {
    font-weight: bold;
    background-color: rgb(255, 182, 193);
}

.file-added {
    font-weight: bold;
    color: rgb(0, 139, 139);
}

.file-removed {
    font-weight: bold;
    color: rgb(0, 0, 139);
}

.dir-to-file {
    font-weight: bold;
    background-color: rgb(255, 182, 193);
}

.dir-added {
    font-weight: bold;
    color: rgb(0, 139, 139);
}

.dir-removed {
    font-weight: bold;
    color: rgb(0, 0, 139);
}

.diff-range {
    background-color: rgb(244, 244, 244);
    color: rgb(165, 42, 42);
    font-weight: bold;
}

.diff-context {
    background-color: rgb(244, 244, 244);
}

.diff-added {
    background-color: rgb(244, 244, 244);
    color: rgb(0, 139, 139);
}

.diff-removed {
    background-color: rgb(244, 244, 244);
    color: rgb(0, 0, 139);
}

.diff-header {
    font-weight: bold;
}
</style>

<div tal:define="lhs request/lhs | string:;
                 rhs request/rhs | string:;
                 ">

<h3> <code>portal_setup</code> Tool </h3>

<p class="form-help">
By selecting two snapshots (or a snapshot and a filesystem setup directory), a
comparison can be made, highlighting the differences between the two
configuration sets.
</p>

<p>Configurations to compare:</p>
<form method="POST" action="."
      tal:attributes="action string:${here/absolute_url}">

<select name="lhs">

  <option value="snapshot-SNAPSHOT_ID"
          tal:repeat="s_info here/listSnapshotInfo"
          tal:attributes="selected python:lhs.endswith( s_info['id'] );
                          value string:snapshot-${s_info/id};
                         "
          tal:content="s_info/title"
  >SNAPSHOT_TITLE</option>

  <option value="profile-PROFILE_ID"
          tal:repeat="p_info here/listProfileInfo"
          tal:attributes="selected python:lhs.endswith( p_info['id'] );
                          value string:profile-${p_info/id};
                         "
          tal:content="p_info/title"
  >PROFILE_TITLE</option>

</select>

<select name="rhs">

  <option value="snapshot-SNAPSHOT_ID"
          tal:repeat="s_info here/listSnapshotInfo"
          tal:attributes="selected python:rhs.endswith( s_info['id'] );
                          value string:snapshot-${s_info/id};
                         "
          tal:content="s_info/title"
  >SNAPSHOT_TITLE</option>

  <option value="profile-PROFILE_ID"
          tal:repeat="p_info here/listProfileInfo"
          tal:attributes="selected python:rhs.endswith( p_info['id'] );
                          value string:profile-${p_info/id};
                         "
          tal:content="p_info/title"
  >PROFILE_TITLE</option>

</select>

<br />

<input type="hidden" name="missing_as_empty:int:default" value="0" />
<input type="checkbox" name="missing_as_empty:boolean" value="1"
       tal:attributes="checked request/missing_as_empty | nothing" />
Treat missing files as empty 

<br />

<input type="hidden" name="ignore_blanks:int:default" value="0" />
<input type="checkbox" name="ignore_blanks:boolean" value="1"
       tal:attributes="checked request/ignore_blanks | nothing" />
Ignore lines of whitespace

<br />

<input type="submit" name="manage_showDiff:method" value="Compare">
<input type="submit" name="manage_downloadDiff:method" value="Download">

</form>

<hr />

<div tal:condition="python: lhs and rhs" >
    
<div tal:define="mae request/missing_as_empty | nothing;
                 ib request/ignore_blanks | nothing;
                 mcc nocall: here/manage_compareConfigurations;
                 comparison python:mcc( lhs, rhs, mae, ib )"
>
<p>
Comparison of <span tal:replace="request/lhs">LHS</span>
          and <span tal:replace="request/rhs">RHS</span>:</p>

<span tal:replace="structure python: here.markupComparison( comparison )"
>COMPARISON HERE</span>

</div>
</div>

</div>

<h1 tal:replace="structure here/manage_page_footer">PAGE FOOTER </h1>



More information about the CMF-checkins mailing list