예제 #1
0
def run_docparse(args):
    deprecated = docparse(args.input, args.pattern)

    cache = Cache()
    key = CacheKey(args.input)
    data = {'deprecated': deprecated,
            'generator': 'manual'}
    cache[key] = data
    if args.verbose:
        print("Found {} deprecated identifier{}".format(
            len(deprecated),
            's' * bool(deprecated)))
        for name in deprecated:
            print(name)
예제 #2
0
def run_docparse(args):
    deprecated = docparse(args.input, args.pattern)

    cache = Cache(cache_dir=args.cache_dir)
    if args.recursive:
        key_factory = RecursiveCacheKeyFactory()
    else:
        key_factory = CacheKeyFactory()
    key = key_factory(args.input)
    data = {'deprecated': deprecated, 'generator': 'manual'}
    cache[key] = data
    if args.verbose:
        print("Found {} deprecated identifier{}".format(
            len(deprecated), 's' * bool(deprecated)))
        for name in deprecated:
            print(name)
예제 #3
0
 def test_docparse(self):
     deprecated = docparse(__file__, r'.*deprecated.*')
     self.assertEqual(deprecated, ['sample_function', 'sample_class'])