dbrtools/dbr/checkenv.py
author MattD <mattd@symbian.org>
Sun, 13 Jun 2010 15:29:20 +0100
branchDBRToolsDev
changeset 283 398d483e91bb
parent 242 9fd4819bf104
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: 200
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: 200
diff changeset
    14
# new checkenv - uses OO interface.
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: 200
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: 212
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
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: 200
diff changeset
    19
def run(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: 200
diff changeset
    20
  location = '/'
212
21d5b62bbd8e DBRTools - Added filter support to checkenv
MattD <mattd@symbian.org>
parents: 205
diff changeset
    21
  filtertype = ''
21d5b62bbd8e DBRTools - Added filter support to checkenv
MattD <mattd@symbian.org>
parents: 205
diff changeset
    22
#using arg for filter...not for other env  
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: 212
diff changeset
    23
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: 200
diff changeset
    24
  db = dbrenv.CreateDB(location)
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: 200
diff changeset
    25
  local = dbrenv.DBRLocalEnv(location)
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: 200
diff changeset
    26
  results = db.compare(local)
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: 200
diff changeset
    27
  local.verify(results.unknown)
205
213f75c7878c DBRTools - checkenv fix for previous submission typo.
MattD <mattd@symbian.org>
parents: 203
diff changeset
    28
  results2 = db.compare(local)
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: 212
diff changeset
    29
  filter = dbrfilter.CreateFilter(args)
212
21d5b62bbd8e DBRTools - Added filter support to checkenv
MattD <mattd@symbian.org>
parents: 205
diff changeset
    30
  filteredresults = filter.filter(results2)
21d5b62bbd8e DBRTools - Added filter support to checkenv
MattD <mattd@symbian.org>
parents: 205
diff changeset
    31
  filteredresults.printdetail()
21d5b62bbd8e DBRTools - Added filter support to checkenv
MattD <mattd@symbian.org>
parents: 205
diff changeset
    32
  filteredresults.printsummary()
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: 200
diff changeset
    33
  db.update(local, results2.touched)
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: 200
diff changeset
    34
  db.save()
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: 200
diff changeset
    35
    
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: 200
diff changeset
    36
def help():
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: 200
diff changeset
    37
  print "Checks the status of the current environment"
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: 200
diff changeset
    38
  print "Usage:"
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: 200
diff changeset
    39
  print "\tdbr checkenv"
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: 200
diff changeset
    40
    
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
    41
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
    42
  return "Checks the status of the current environment"
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
    43