Commit 1d4f81f0 authored by Lars Kruse's avatar Lars Kruse

setup: use 'os.walk' instead of recursive 'glob' (compatible with python3.4)

parent 55ff828a
import os
from setuptools import setup, find_packages from setuptools import setup, find_packages
from os import path
import glob
from stadt import VERSION from stadt import VERSION
...@@ -14,15 +14,15 @@ def get_requirements(): ...@@ -14,15 +14,15 @@ def get_requirements():
def get_readme(): def get_readme():
with open(path.join(path.dirname(__file__), 'README.md')) as f: with open(os.path.join(os.path.dirname(__file__), 'README.md')) as f:
return f.read() return f.read()
def include_recursive(directory, query=''): def include_recursive(directory):
result = {} result = {}
for file in glob.iglob('{}/**{}'.format(directory, query), recursive=True): for dirpath, dirnames, filenames in os.walk(directory):
if path.isfile(file): if filenames:
result.setdefault(path.dirname(file), []).append(file) result[dirpath] = [os.path.join(dirpath, fname) for fname in filenames]
return tuple(result.items()) return tuple(result.items())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment