-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathlistPyPlugs.py
49 lines (38 loc) · 1.22 KB
/
listPyPlugs.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
#This Source Code Form is subject to the terms of the Mozilla Public
#License, v. 2.0. If a copy of the MPL was not distributed with this
#file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#Created by Fabrice Fernandez on 17/01/2018.
import os
import string
from NatronEngine import*
# LISTS NATRON PYPLUGS #
def listPyPlugs():
fileList = []
folderCount = 0
fileCount = 0
pyplugCount = 0
myPath = natron.getNatronPath()
listIndex = 0
for p in myPath:
currentPath = myPath[listIndex]
listIndex += 1
folderCount += 1
for root, subFolders, files in os.walk(currentPath):
for file in files:
filename1 ="init.py"
filename2 = 'initGui.py'
filename3 = "__init__.py"
if file != filename1 :
if file != filename2 :
if file != filename3 :
fileList = sorted(fileList, key=lambda s: s.lower())
if file.endswith(".py") :
file = file[:-3]
fileList.append( ' + ' + file )
fileCount +=1
print ('\n' + '\n' + '- IN [ ' + p + ' ] :' + ' ' + str(fileCount) + ' PyPlug(s)')
print ('\n' + '\n'.join(fileList))
fileList = []
pyplugCount += fileCount
fileCount = 0
print ('\n' + '- ' + str(pyplugCount) + ' PYPLUGS/PYTHON SCRIPTS AVAILABLE ON THE SYSTEM')