예제 #1
0
파일: wizimage.py 프로젝트: SanniZ/mypy3
 def get_user_input(self):
     args = Base.get_user_input('hs:t:v')
     # help
     if '-h' in args:
         Base.print_help(self.help_menu)
     # src path
     if '-s' in args:
         self._src = Path.get_abs_path(args['-s'])
     # dst path
     if '-t' in args:
         self._dst = Path.get_abs_path(args['-t'])
     # show
     if '-v' in args:
         self._show = True
     # start to check args.
     # start id is must be set, otherwise return..
     if self._src == None:
         return False
     # next to start if _end is not set.
     if self._dst == None:
         self._dst = Path.get_current_path()
         print('warnning: no found -t, output to: %s' % self._dst)
     return True
예제 #2
0
파일: cleanpyc.py 프로젝트: SanniZ/mypy3
                if File.get_exname(f) == '.pyc':
                    os.remove(f)
                    if show:
                        print('remove: %s' % f)
            if dr:
                for d in dr:
                    if d == '__pycache__':
                        os.remove(d)


if __name__ == '__main__':
    args = Base.get_user_input('hp:vc')
    # help
    if '-h' in args:
        Base.print_help(help_menu)
    # check path.
    if '-p' in args:
        if re.match('\.', args['-p']):
            path = re.sub('.', Path.get_current_path(), args['-p'])
        else:
            path = args['-p']
    else:
        path = Path.get_current_path()
    # check show.
    if '-v' in args:
        show = True
    else:
        show = False
# clean .pyc now.
    clean_pyc(path, show)