Code Duplication    Length = 12-12 lines in 2 locations

packaging/Windows/setup.py 1 location

@@ 28-39 (lines=12) @@
25
        if os.path.isfile(file_path):
26
            resources.append(file_path)
27
		
28
def collect_packages(path, package_name, packages, excludes=None):
29
    for dir in os.listdir(path):
30
        if excludes and dir in excludes:
31
            continue
32
        subpath = os.path.join(path, dir)
33
        if os.path.isdir(subpath):
34
            if os.path.exists(os.path.join(subpath, '__init__.py')):
35
                subpackage_name = dir
36
                if len(package_name) > 0:
37
                    subpackage_name = package_name + '.' + subpackage_name
38
                packages.append(subpackage_name)
39
                collect_packages(subpath, subpackage_name, packages)
40
41
packages = []
42
collect_packages('.', '', packages, excludes=['test'])

packaging/MacOS/setup.py 1 location

@@ 22-33 (lines=12) @@
19
for file in os.listdir(resources_root):
20
    resources.append(os.path.join(resources_root, file))
21
22
def collect_packages(path, package_name, packages, excludes=None):
23
    for dir in os.listdir(path):
24
        if excludes and dir in excludes:
25
            continue
26
        subpath = os.path.join(path, dir)
27
        if os.path.isdir(subpath):
28
            if os.path.exists(os.path.join(subpath, '__init__.py')):
29
                subpackage_name = dir
30
                if len(package_name) > 0:
31
                    subpackage_name = package_name + '.' + subpackage_name
32
                packages.append(subpackage_name)
33
                collect_packages(subpath, subpackage_name, packages)
34
35
packages = []
36
collect_packages('.', '', packages, excludes=['test'])