|
1 # |
|
2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 # All rights reserved. |
|
4 # This component and the accompanying materials are made available |
|
5 # under the terms of "Eclipse Public License v1.0" |
|
6 # which accompanies this distribution, and is available |
|
7 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 # |
|
9 # Initial Contributors: |
|
10 # Nokia Corporation - initial contribution. |
|
11 # |
|
12 # Contributors: |
|
13 # |
|
14 # Description: |
|
15 # |
|
16 |
|
17 import os |
|
18 |
|
19 def setup(): |
|
20 |
|
21 # NPP and BT GPS PSY Cenrep file location |
|
22 btpsyfile = "\\epoc32\\RELEASE\\winscw\\UDEB\\Z\\private\\10202be9\\101FE999.txt" |
|
23 npppsyfile = "\\epoc32\\RELEASE\\winscw\\UDEB\\Z\\private\\10202be9\\10206915.txt" |
|
24 |
|
25 # Path where landmark databases lie in the emulator environment |
|
26 lmpath = "\\epoc32\\winscw\\c\\Private\\100012a5\\" |
|
27 |
|
28 print "Setup for Location API module tests" |
|
29 |
|
30 if (os.path.isfile(btpsyfile)): |
|
31 # Remove old temp file if still exists |
|
32 if( os.path.isfile(btpsyfile+'.tmp')): |
|
33 os.remove(btpsyfile+'.tmp') |
|
34 # Rename existing Bluetooth GPS PSY file to temp file |
|
35 os.rename(btpsyfile,btpsyfile+'.tmp') |
|
36 print "Renamed: " + btpsyfile |
|
37 if (os.path.isfile(npppsyfile)): |
|
38 # Remove old temp file if still exists |
|
39 if( os.path.isfile(npppsyfile+'.tmp')): |
|
40 os.remove(npppsyfile+'.tmp') |
|
41 # Rename existing NPP PSY file to temp file |
|
42 os.rename(npppsyfile,npppsyfile+'.tmp') |
|
43 print "Renamed: " + npppsyfile |
|
44 |
|
45 # Compile test PSY to the emulator environment |
|
46 if (os.path.exists('..\\ViperTestPSY\\group\\')): |
|
47 os.chdir(r'..\\ViperTestPSY\\group\\') |
|
48 os.system(r'bldmake bldfiles') |
|
49 os.system(r'abld cleanexport') |
|
50 os.system(r'abld build winscw udeb') |
|
51 |
|
52 # Remove existing landmark databases from the emulator |
|
53 if (os.path.exists(lmpath)): |
|
54 print "Deleting landmark databases" |
|
55 os.system(r'del '+lmpath+'*.ldb') |
|
56 |
|
57 print "Setup is done." |
|
58 |
|
59 if __name__ == "__main__": |
|
60 # If this module was started as the main module (given as the py-file to |
|
61 # python.exe) take command line arguments and pass them to replaceFile |
|
62 setup() |