-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests_old.py
More file actions
118 lines (99 loc) · 2.9 KB
/
tests_old.py
File metadata and controls
118 lines (99 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#! /usr/bin/python
# To change this template, choose Tools | Templates
# and open the template in the editor.
__author__="langiewi_m"
__date__ ="$Jul 1, 2010 12:17:34 PM$"
import common
from pprint import pprint
def test_walk(arg, dir, files):
print "test_walk: arg:", arg, "dir:", dir
print "files:"
for file in files:
print file
print
if __name__ == "__main__":
VIEW = "MAREK_PORTA"
"""
include_porta_vobs = "porta(_(kernel(_2_4_31)?)|(tools))?"
include_vobs = "(common_software)|(components)|(danube_tc)|(" + include_porta_vobs + ")"
exclude = "/view/" + VIEW + "/vobs/(?!(" + include_vobs + ")).+"
print exclude
exclude = "(.*/.*/.*/.*/.*/.*/.*/.*/.*/.*)|(" + exclude + ")"
#common.walk_exclude("/home/langiewi_m/tmp/walktest/", test_walk, "dupa", exclude)
"""
"""
view/gjsdfkljsd
view/MAREK_PORTA/vla
x view/MAREK_PORTA/vobs
x view/MAREK_PORTA/vobs/components
x view/MAREK_PORTA/vobs/common_software
x view/MAREK_PORTA/vobs/danube_tc
x view/MAREK_PORTA/vobs/porta
x view/MAREK_PORTA/vobs/porta_kernel
x view/MAREK_PORTA/vobs/porta_kernel_2_4_31
x view/MAREK_PORTA/vobs/porta_tools
view/MAREK_PORTA/vobs/dupa
"""
#/view/MAREK_PORTA/vobs/(?!((common_software)|(components)|(danube_tc)|(porta(_(kernel(_2_4_31)?)|(tools))?))).+
"""
(?!
view/MAREK_PORTA/vobs
(
/
(
(components)|
(common_software)|
(danube_tc)|
(
porta(
(_kernel(_2_4_31)?)|
(_tools)
)?
)
)
)?
)
"""
"""
(
(?!
/view/MAREK_PORTA/vobs
)
|
/view/MAREK_PORTA/vobs
(?!
(
$
|
(/components)
|
(/common_software)
|
(/danube_tc)
|
(
/porta
(
$
|
(_tools)
|
(_kernel)
(
$
|
(_2_4_31)
)
)
)
)
)
)
"""
#full_vobs_dir = "/view/" + VIEW + "/vobs"
full_vobs_dir = "/home/langiewi_m/tmp/walktest/vobs"
porta_alternative = "$|(_tools)|(_kernel($|(_2_4_31)))"
alternative = "$|(/components)|(/common_software)|(/danube_tc)|(/porta(" + porta_alternative + "))"
exclude = "^((?!"+ full_vobs_dir +")|(" + full_vobs_dir + "(?!" + alternative + ")))"
exclude = "((.*/){8})|(lost\\+found)|(" + exclude + ")"
common.walk_exclude("/home/langiewi_m/tmp/walktest/", test_walk, "dupa", exclude)