2
# -*- coding: utf-8 -*-
5
# Copyright (C) 2013 ~ 2014 National University of Defense Technology(NUDT) & Kylin Ltd
6
# This program is free software: you can redistribute it and/or modify it
7
# under the terms of the GNU General Public License version 3, as published
8
# by the Free Software Foundation.
10
# This program is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranties of
12
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
13
# PURPOSE. See the GNU General Public License for more details.
15
# You should have received a copy of the GNU General Public License along
16
# with this program. If not, see <http://www.gnu.org/licenses/>.
23
return os.path.expanduser('~')
25
# check dirs with given filters and filtertype
26
def check_dirs(dirs, filters, filtertype):
30
if os.path.isdir(onedir):
31
for f in os.listdir(onedir):
32
if use_filters(os.path.join(onedir, f), filters, filtertype):
38
# check the fpathdir with filters filtertype: True == include, False == exlude
39
def use_filters(fpath, filters, filtertype):
41
if os.path.isdir(fpath) == False:
45
for onefilter in filters:
46
if os.path.exists(os.path.join(fpath, onefilter)):
52
for onefilter in filters:
53
if os.path.exists(os.path.join(fpath, onefilter)):
b'\\ No newline at end of file'