Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bl4ckbo7 committed Apr 28, 2019
1 parent b9d94b0 commit 150a851
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 25 deletions.
55 changes: 30 additions & 25 deletions agt
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,48 @@ try:
from core.search import Search
from core.clone import Clone

except ImportError:
print("\n[x] Oops! Can't find module, or can't find name in module!")
sys.exit(1)
#This code runs with Python 3 ONLY.
if sys.version_info[0] < 3:
print("\n[x] This code runs with Python 3 only!")
sys.exit(1)

#This code runs on Linux Platform ONLY
assert ('linux' in sys.platform)

if sys.version_info[0] < 3: #This code runs with Python 3 ONLY.
print("\n[x] This code runs with Python 3 only!")
sys.exit(1)
#check if paths ~/.agt , ~/.agt/clones/ and ~/.agt/temp/ exist
if os.path.exists(os.path.expanduser('~/.agt')) == True:
if os.path.exists(os.path.expanduser(Conf.DEFAULTS['OUTPUT_DIR'])) == False:
os.mkdir(os.path.expanduser('~/.agt/clones'))

try:
assert ('linux' in sys.platform) #This code runs on Linux Platform ONLY
elif os.path.exists(os.path.expanduser(Conf.DEFAULTS['TEMP_DIR'])) == False:
os.mkdir(os.path.expanduser('~/.agt/temp'))
open(Conf.DEFAULTS['TEMP_DIR'] + 'important.txt', 'w+').write('PlEASE, DO NOT DELETE THIS DIRECTORY.')

except AssertionError:
print("\n[x] This code runs on Linux Platform only!")
sys.exit(1)
else:
pass

#check if paths ~/.agt , ~/.agt/clones/ and ~/.agt/temp/ exist
if os.path.exists(os.path.expanduser('~/.agt')) == True:
if os.path.exists(os.path.expanduser(Conf.DEFAULTS['OUTPUT_DIR'])) == False:
else:
os.mkdir(os.path.expanduser('~/.agt'))
os.mkdir(os.path.expanduser('~/.agt/clones'))

elif os.path.exists(os.path.expanduser(Conf.DEFAULTS['TEMP_DIR'])) == False:
os.mkdir(os.path.expanduser('~/.agt/temp'))
open(Conf.DEFAULTS['TEMP_DIR'] + 'important.txt', 'w+').write('PlEASE, DO NOT DELETE THIS DIRECTORY.')
open(os.path.expanduser(Conf.DEFAULTS['TEMP_DIR'] + 'important.txt'), 'w+').write('PlEASE, DO NOT DELETE THIS DIRECTORY.\n')

else:
pass
except ImportError:
print("\n[x] Oops! Can't find module, or can't find name in module!")
sys.exit(1)

except AssertionError:
print("\n[x] This code runs on Linux Platform only!")
sys.exit(1)

except KeyboardInterrupt:
print("\n[!] Exited!")
sys.exit(1)

else:
os.mkdir(os.path.expanduser('~/.agt'))
os.mkdir(os.path.expanduser('~/.agt/clones'))
os.mkdir(os.path.expanduser('~/.agt/temp'))
open(os.path.expanduser(Conf.DEFAULTS['TEMP_DIR'] + 'important.txt'), 'w+').write('PlEASE, DO NOT DELETE THIS DIRECTORY.\n')

def main():

try:

#Processing commandline arguments
parser = argparse.ArgumentParser(prog="./agt", formatter_class=argparse.RawDescriptionHelpFormatter,
description=textwrap.dedent('''\
Expand Down
Binary file removed screenshots/agt_clone1.png
Binary file not shown.
Binary file removed screenshots/agt_clone2.png
Binary file not shown.
Binary file removed screenshots/agt_help.png
Binary file not shown.
Binary file removed screenshots/agt_help2.png
Binary file not shown.
Binary file removed screenshots/agt_search.png
Binary file not shown.
Binary file removed screenshots/agt_show1.png
Binary file not shown.
Binary file removed screenshots/agt_show2.png
Binary file not shown.

0 comments on commit 150a851

Please sign in to comment.