-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesting.py
More file actions
30 lines (23 loc) · 788 Bytes
/
Copy pathtesting.py
File metadata and controls
30 lines (23 loc) · 788 Bytes
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
import os
from itertools import chain
import subprocess
from subprocess import DEVNULL
scalac = "/Users/arunkumar/scala/bin/scalac"
def find_all(basedir, pred):
for root, dirs, files in os.walk(basedir):
for fn in files:
path = os.path.join(root, fn)
if pred(path):
yield path
files = chain(
find_all("/Users/arunkumar/dotty/", lambda p: p.endswith('.scala')),
find_all("/Users/arunkumar/scala2/", lambda p: p.endswith('.scala')))
added_files = chain(
find_all("/Users/arunkumar/scalaAnalysis/scalaTrainingData/", lambda p: p.endswith('.scala')))
addedfiles = map(lambda x: os.path.basename(x), added_files)
# print(added_files)
#
if 'sammy_restrictions.scala' in addedfiles:
print('yes')
else:
print('No!!!')