PK͉|Itwatchman/.DS_StoreBud1cache_ __pycache__vSrnlong  @ @ @ @ EDSDB ` @ @ @PKQ}I:ppwatchman/__init__.py""" watchman: version control status management made easy.""" __version__ = '0.0.5' __author__ = 'Aleph Melo' PK}IZ3watchman/main.pyfrom __future__ import print_function from argparse import ArgumentParser import sys import os from sh import cd, hg, watchman, git SCM_OPTIONS = ['git', 'hg'] def _get_subdirectories(current_dir): return [directory for directory in os.listdir(current_dir) if os.path.isdir(os.path.join(current_dir, directory)) and directory[0] != '.'] def check(scm): if scm == 'hg': command = "hg.branch('-R', './%s' % child)" elif scm == 'git': command = "git('name-rev', '--name-only', 'HEAD')" if scm in SCM_OPTIONS: current_working_directory = os.getcwd() child_dirs = _get_subdirectories(current_working_directory) for child in child_dirs: try: current_branch = eval(command) output = '%-25s is on branch: %s' % (child, current_branch) print(output, end='') except Exception as e: continue else: print("The scm you typed is not supported yet or you just misspelled\nCurrent options are: hg (mercurial) or git.\n") print(watchman('--help')) def main(): parser = ArgumentParser() parser.add_argument('check', help='checks branch status of all immediate subdirectories') parser.add_argument('-s', '--scm', help='specify source code management application commands\ options: hg (mercurial) or git', action='store') arguments = parser.parse_args() if arguments.check: if arguments.scm is not None: check(arguments.scm) else: arguments.scm = 'hg' check(arguments.scm) if __name__ == '__main__': main() PK!H7 *1)watchman-0.0.5.dist-info/entry_points.txtN+I/N.,()*O,IMSU1r3@PK!H|&Ubwatchman-0.0.5.dist-info/WHEEL HM K-*ϳR03rOK-J,/RH,Q034 /, (-JLR()*M ILR(4KM̫#DPK!HOX!watchman-0.0.5.dist-info/METADATA]N0 F~BT .ZDJ8C{{R1ĝsYqDB4~RPˍё/A;*YkOa8 N? ~-DFN2#98#a