Browse Source

incomplete; started on build.py and added get_drives to util

master
Raphael Roberts 7 years ago
parent
commit
c4aa56c5c2
  1. 9
      build.py
  2. 2
      requirements.txt
  3. 15
      util.py

9
build.py

@ -0,0 +1,9 @@
import os
from util import get_drives()
def build(after,*starts):
if starts:
paths = starts
else:
paths = get_drives()
for path in paths:
for root,dirs,files in os.walk(

2
requirements.txt

@ -0,0 +1,2 @@
binaryornot
ctypes

15
util.py

@ -1,4 +1,17 @@
def pparent(paths):
from ctypes import windll
#https://stackoverflow.com/questions/827371/is-there-a-way-to-list-all-the-available-drive-letters-in-python u=RichieHindle
def get_drives():
uppercase = map(chr,range(ord('A'),ord('A')+26))
drives = []
bitmask = windll.kernel32.GetLogicalDrives()
for letter in uppercase:
if bitmask & 1:
drives.append(f'{letter}:\\')
bitmask >>= 1
return drives
def no_parents(paths):
paths = sorted(paths,key=len)
first = True
ret = []

Loading…
Cancel
Save