author | MattD <mattd@symbian.org> |
Mon, 22 Mar 2010 12:28:48 +0000 | |
changeset 212 | 21d5b62bbd8e |
parent 205 | 213f75c7878c |
child 242 | 9fd4819bf104 |
permissions | -rw-r--r-- |
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 |
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
|
17 |
|
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
|
18 |
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
|
19 |
location = '/' |
212
21d5b62bbd8e
DBRTools - Added filter support to checkenv
MattD <mattd@symbian.org>
parents:
205
diff
changeset
|
20 |
filtertype = '' |
21d5b62bbd8e
DBRTools - Added filter support to checkenv
MattD <mattd@symbian.org>
parents:
205
diff
changeset
|
21 |
#using arg for filter...not for other env |
21d5b62bbd8e
DBRTools - Added filter support to checkenv
MattD <mattd@symbian.org>
parents:
205
diff
changeset
|
22 |
if(len(args)): |
21d5b62bbd8e
DBRTools - Added filter support to checkenv
MattD <mattd@symbian.org>
parents:
205
diff
changeset
|
23 |
filtertype = args[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:
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) |
212
21d5b62bbd8e
DBRTools - Added filter support to checkenv
MattD <mattd@symbian.org>
parents:
205
diff
changeset
|
29 |
filter = dbrenv.CreateFilter(filtertype) |
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 |
|
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
|
41 |
|
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 |