PK͉|Itwatchman/.DS_StoreBud1cache_ __pycache__vSrnlong  @ @ @ @ EDSDB ` @ @ @PKID#ppwatchman/__init__.py""" watchman: version control status management made easy.""" __version__ = '0.0.8' __author__ = 'Aleph Melo' PKsILoӆwatchman/main.pyfrom __future__ import print_function from argparse import ArgumentParser from colorama import Fore, init from sh import cd, hg, git, watchman import sys import os init(autoreset=True) # colorama init SCM_OPTIONS = ['git', 'hg'] TEXT_COLOR = Fore.GREEN 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('--git-dir', './%s/.git' % (child), '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%s' % (child, TEXT_COLOR, 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.8.dist-info/entry_points.txtN+I/N.,()*O,IMSU1r3@PK!H|&Ubwatchman-0.0.8.dist-info/WHEEL HM K-*ϳR03rOK-J,/RH,Q034 /, (-JLR()*M ILR(4KM̫#DPK!H'-Z!watchman-0.0.8.dist-info/METADATAN0E8} ,EjT%Ja=Ē㴥s߱='-2orVB_ p@.*6h=ɺ1}H؟(e4FnD K2d9.ɓ3QP1AfYj>DLʐv*Ȇoϋ"5\9/aԱ0𹔒A%\)X_]'N~ɡD/PK!He[watchman-0.0.8.dist-info/RECORDuMz0}B) YFRPɗ&@"?~fcۍxo$P_{Q-Jޗaٿ):;v @?7+w^dpj;MuyƔQwo^7}@ &[f^MtLE׍oB(r:ƍ( z[7n>ACֿ zTMuԂ LY_J&2)T9ɯ! 9o2)ʷ04]+YAb&pRLCߏM?xR,tG!,?"Iwt