Пример #1
0
                        help='Show a pym command')


def show(lines, args):
    debuggers.break_ere()
    if args.edit:
        print as_vim_command(lines, '-s' in args)
        return
    if args.pudb:
        debugger = debuggers.PudbDebugger()
    elif args.ipdb:
        debugger = debuggers.IpdbDebugger()
    else:
        debugger = debuggers.pymdbDebugger()
    debugger.add_breaks(lines)


def script(args):
    """Run the script"""
    stream = text_streams.first_argv('-c')
    if not stream:
        print >> sys.stderr, 'No file specified'
        return not os.EX_OK
    lines = map(tracebacks.parse_line, text_streams.full_lines(stream))
    show([_ for _ in lines if _], args)
    return os.EX_OK


if __name__ == '__main__':
    scripts.main(script, add_args, __version__, __doc__)
Пример #2
0
    for path_to_sub_directory in path_to_directory.walkdirs():
        if repository.is_repository_path(path_to_sub_directory):
            continue
        tag_directory(path_to_directory)


def read_sys_dirs():
    """Read tags for each path in sys.path"""
    tags = []
    for path_to_system in sys.path:
        tags.append(read_dir_tags(paths.path(path_to_system)))
    return tags


def all_directories_in_a_list_of_tags(tags):
    """Get a sorted list of all the directories mentioned in the given tags"""
    return sorted({paths.home().relpathto(t.path.parent) for t in tags})


def script(args):
    """Run the program"""
    directory = args.source or paths.pwd()
    if args.recursive:
        tag_directory_recursively(directory)
    else:
        tag_directory(directory)


if __name__ == '__main__':
    scripts.main(script, add_args, docstring=__doc__)
Пример #3
0
            continue
        tags = read_dirs(path_to_sub_directory)
        write_dir(path_to_sub_directory, tags)


def read_sys_dirs():
    """Read tags for each path in sys.path"""
    tags = []
    for path_to_system in sys.path:
        tags.append(read_dir(paths.path(path_to_system)))
    return tags


def all_directories_in_a_list_of_tags(tags):
    """Get a sorted list of all the directories mentioned in the given tags"""
    return sorted({paths.home().relpathto(t.path.parent) for t in tags})


def script(args):
    """Run the program"""
    if args.recursive:
        read_write_dirs(args.source)
    else:
        read_write_dir()


if __name__ == '__main__':
    scripts.main(
        script, add_args,
        help_='Create a tags file for Python programs, usable with vi.')
Пример #4
0
    for path_to_sub_directory in path_to_directory.walkdirs():
        if repository.is_repository_path(path_to_sub_directory):
            continue
        tag_directory(path_to_directory)


def read_sys_dirs():
    """Read tags for each path in sys.path"""
    tags = []
    for path_to_system in sys.path:
        tags.append(read_dir_tags(paths.path(path_to_system)))
    return tags


def all_directories_in_a_list_of_tags(tags):
    """Get a sorted list of all the directories mentioned in the given tags"""
    return sorted({paths.home().relpathto(t.path.parent) for t in tags})


def script(args):
    """Run the program"""
    directory = args.source or paths.pwd()
    if args.recursive:
        tag_directory_recursively(directory)
    else:
        tag_directory(directory)


if __name__ == '__main__':
    scripts.main(script, add_args, docstring=__doc__)