-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseqCheck.py
More file actions
executable file
·72 lines (59 loc) · 1.53 KB
/
seqCheck.py
File metadata and controls
executable file
·72 lines (59 loc) · 1.53 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
#! /usr/bin/env python
import os
import array as array
import sys
if (len(sys.argv)==1):
print("usage >>seqCheck.py [fileRootName, path ('.') for cwd]")
sys.exit()
elif (len(sys.argv)==2):
fileRootName = sys.argv[1]
rootpath = os.getcwd()
elif (len(sys.argv)==3):
fileRootName = sys.argv[1]
rootpath = os.getcwd() + sys.argv[2]
print rootpath
else:
print("usage >>seqCheck.py [fileRootname, path ('.') for cwd]")
'''
mypath = os.getcwd()
print("Path at terminal when executing this file")
print(os.getcwd() + "\n")
print("This file path, relative to os.getcwd()")
print(__file__ + "\n")
print("This file full path (following symlinks)")
full_path = os.path.realpath(__file__)
print(full_path + "\n")
print("This file directory and name")
path, file = os.path.split(full_path)
print(path + ' --> ' + file + "\n")
print("This file directory only")
print(os.path.dirname(full_path))
'''
f = []
for (dirpath,dirnames,filenames) in os.walk(rootpath):
#print filenames
f.extend(filenames)
break
print len(f)
num = []
#narray = array("i")
for x in f:
y = x.split(".")
if len(y) >1:
try:
z =int(y[1])
except (SyntaxError, ValueError):
pass
num.append(z)
#narray.append(z)
mylist = sorted(num)
end = len(mylist)
start = mylist[0]
print("start is " + str(start))
for x in mylist:
#print(str(x) + " "+ str(start))
if x != start:
print(str(start) + " is missing")
break
start += 1
print("There are "+ str(end) + " files")