dbrtools/dbr/diffenv.py
author MattD <mattd@symbian.org>
Sun, 13 Jun 2010 15:29:20 +0100
branchDBRToolsDev
changeset 283 398d483e91bb
parent 242 9fd4819bf104
child 285 6a928cf9e181
permissions -rw-r--r--
Changed help so that summaries come from components. Added smoketest method to try to reduce regressions (when I write some tests). A few minor cleanups.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
203
e274d29c8bc9 Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents: 179
diff changeset
     1
# Copyright (c) 2010 Symbian Foundation Ltd
179
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
     2
# This component and the accompanying materials are made available
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
     3
# under the terms of the License "Eclipse Public License v1.0"
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
     4
# which accompanies this distribution, and is available
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
     5
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
     6
#
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
     7
# Initial Contributors:
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
     8
# Symbian Foundation Ltd - initial contribution.
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
     9
#
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
    10
# Contributors:
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
    11
# mattd <mattd@symbian.org>
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
    12
#
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
    13
# Description:
203
e274d29c8bc9 Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents: 179
diff changeset
    14
# new diffenv - uses OO interface and can have 
179
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
    15
203
e274d29c8bc9 Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents: 179
diff changeset
    16
import dbrenv
242
9fd4819bf104 DBRTools - Added filtering support. It's currently implmented in checkenv and diffenv, but adding it to other commands is pretty easy.
MattD <mattd@symbian.org>
parents: 208
diff changeset
    17
import dbrfilter
179
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
    18
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
    19
def run(args):
203
e274d29c8bc9 Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents: 179
diff changeset
    20
    if(len(args)):
e274d29c8bc9 Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents: 179
diff changeset
    21
      if(len(args) == 1):
e274d29c8bc9 Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents: 179
diff changeset
    22
        first = '/'
242
9fd4819bf104 DBRTools - Added filtering support. It's currently implmented in checkenv and diffenv, but adding it to other commands is pretty easy.
MattD <mattd@symbian.org>
parents: 208
diff changeset
    23
        second = args.pop(0)        
203
e274d29c8bc9 Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents: 179
diff changeset
    24
      else:
242
9fd4819bf104 DBRTools - Added filtering support. It's currently implmented in checkenv and diffenv, but adding it to other commands is pretty easy.
MattD <mattd@symbian.org>
parents: 208
diff changeset
    25
        first = args.pop(0)
9fd4819bf104 DBRTools - Added filtering support. It's currently implmented in checkenv and diffenv, but adding it to other commands is pretty easy.
MattD <mattd@symbian.org>
parents: 208
diff changeset
    26
        second = args.pop(0)
9fd4819bf104 DBRTools - Added filtering support. It's currently implmented in checkenv and diffenv, but adding it to other commands is pretty easy.
MattD <mattd@symbian.org>
parents: 208
diff changeset
    27
      filter = dbrfilter.CreateFilter(args)
203
e274d29c8bc9 Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents: 179
diff changeset
    28
      db1=dbrenv.CreateDB(first)
e274d29c8bc9 Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents: 179
diff changeset
    29
      db2=dbrenv.CreateDB(second)
e274d29c8bc9 Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents: 179
diff changeset
    30
      results = db1.compare(db2)
283
398d483e91bb Changed help so that summaries come from components. Added smoketest method to try to reduce regressions (when I write some tests). A few minor cleanups.
MattD <mattd@symbian.org>
parents: 242
diff changeset
    31
#      results.printdetail()
208
01c2b1268053 Embryonic support for filtering. Can now use a file list with diffenv to filter the results.
MattD <mattd@symbian.org>
parents: 203
diff changeset
    32
      filteredresults = filter.filter(results)
01c2b1268053 Embryonic support for filtering. Can now use a file list with diffenv to filter the results.
MattD <mattd@symbian.org>
parents: 203
diff changeset
    33
      filteredresults.printdetail()
01c2b1268053 Embryonic support for filtering. Can now use a file list with diffenv to filter the results.
MattD <mattd@symbian.org>
parents: 203
diff changeset
    34
      filteredresults.printsummary()
179
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
    35
    else:
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
    36
      help()
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
    37
      
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
    38
def help():
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
    39
  print "Compares two environments"
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
    40
  print "Usage:"
203
e274d29c8bc9 Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents: 179
diff changeset
    41
  print "\tdbr diffenv <drive1> (<drive2>)"
179
eab8a264a833 Pulled the DBRTools from their own repo and popped them into this one. Still very much a 'work in progress'.
MattD <mattd@symbian.org>
parents:
diff changeset
    42
    
203
e274d29c8bc9 Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents: 179
diff changeset
    43
  
283
398d483e91bb Changed help so that summaries come from components. Added smoketest method to try to reduce regressions (when I write some tests). A few minor cleanups.
MattD <mattd@symbian.org>
parents: 242
diff changeset
    44
def summary():
398d483e91bb Changed help so that summaries come from components. Added smoketest method to try to reduce regressions (when I write some tests). A few minor cleanups.
MattD <mattd@symbian.org>
parents: 242
diff changeset
    45
  return "Compares two baselines"