PK͉|Itwatchman/.DS_StoreBud1cache_ __pycache__vSrnlong  @ @ @ @ EDSDB ` @ @ @PKű~IEppwatchman/__init__.py""" watchman: version control status management made easy.""" __version__ = '0.0.7' __author__ = 'Aleph Melo' PK~ILoӆ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.7.dist-info/entry_points.txtN+I/N.,()*O,IMSU1r3@PK!H|&Ubwatchman-0.0.7.dist-info/WHEEL HM K-*ϳR03rOK-J,/RH,Q034 /, (-JLR()*M ILR(4KM̫#DPK!H0X!watchman-0.0.7.dist-info/METADATA]N0 y @v; ED&Nb9,$ޞT"q}YvG#2ZnD|!$VVJވcrOPp1`o!2r9ƋQ1g@3QɰNrDKvd}ߛ?M}P..tY~XkȭO,,h> k$(yLRw_,3@7U^|8ꦩePK!HU$Zwatchman-0.0.7.dist-info/RECORDuͻv0н( 0tH  KNQ"_Iw";֔ʋ$i ߢ[>Ed4<(~vkgS!2^;EL"_;d'p H*%[p=Pi`3Pj?gCp #eJa~Sb9THRdEuBbl^ .ڑ\E'x }ƌ$Kq헪tͶ/'}y|wt q&:ƅȽxKN_agЂ fIL9:kam-¬V^e