Skip to content

Commit

Permalink
Fixing properties and checking for existence of link before validation
Browse files Browse the repository at this point in the history
  • Loading branch information
KingAkeem committed Oct 20, 2018
1 parent 5832d1a commit a9d945d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion modules/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_links(node):
"""
def retrieve_link(child):
link = child.get('href')
if LinkNode.valid_link(link) and link:
if link and LinkNode.valid_link(link):
return link
return None

Expand Down
15 changes: 7 additions & 8 deletions torBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ def main():
"""
args = get_args()
connect(args.ip, args.port)
try:
node = LinkNode(args.url)
except (ValueError, HTTPError, ConnectionError) as err:
raise err

# If flag is -v, --update, -q/--quiet then user only runs that operation
# because these are single flags only
Expand All @@ -145,13 +141,16 @@ def main():
# If url flag is set then check for accompanying flag set. Only one
# additional flag can be set with -u/--url flag
if args.url:
try:
node = LinkNode(args.url)
except (ValueError, HTTPError, ConnectionError) as err:
raise err
LinkIO.display_ip()
# -m/--mail
if args.mail:
emails = node.get_emails()
print(emails)
print(node.emails)
if args.save:
saveJson('Emails', emails)
saveJson('Emails', node.emails)
# -i/--info
elif args.info:
execute_all(node.name)
Expand All @@ -167,7 +166,7 @@ def main():
else:
LinkIO.display_children(node)
if args.save:
saveJson("Links", node.get_children())
saveJson("Links", node.links)
else:
print("usage: See torBot.py -h for possible arguments.")

Expand Down

0 comments on commit a9d945d

Please sign in to comment.