-
Notifications
You must be signed in to change notification settings - Fork 0
/
presRv.py
executable file
·65 lines (49 loc) · 1.57 KB
/
presRv.py
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
#!/usr/bin/env python
# coding:utf-8
""":mod:`presRv` -- dummy module
===================================
.. module:: moduleName
:platform: Unix
:synopsis: module idea
"""
# Python built-in modules import
# Third-party modules import
# Mikros modules import
__author__ = "duda"
__copyright__ = "Copyright 2016, Mikros Image"
import os
import argparse
import subprocess
_PRESENTATIONDIR_= "/_presentation/" # directory name for presentation
PresPath = os.environ['PROD_ROOT']+ _PRESENTATIONDIR_ #presentation general path
def get_args():
#Assign description to the help doc
parser = argparse.ArgumentParser(description = "play all the file of type ft under the directory in rv")
parser.add_argument('--ft','-ft', type=str, help='file type')
parser.add_argument('-d', '--d', type = str, help='directory')
args = parser.parse_args()
fileType = args.ft
directory = args.d
return fileType, directory
def main():
fileType, directory = get_args()
if fileType == None:
fileType = ".mov"
else:
fileType = "." + fileType
if directory == None:
directory = '.'
rvAllPath = "rv"
for i in listDir(directory,fileType):
rvAllPath += (" " + i)
rvAllPath += " &"
os.system(rvAllPath)
def listDir(dir = ".",fType= ".mov"):
fileList = []
for dirname, dirnames, filenames in os.walk(dir):
# print path to all filenames.
for filename in filenames:
if filename.rfind(".mov") > 0:
fileList.append(os.path.join(dirname, filename))
return fileList
main()