Ejemplo n.º 1
0
 def fetchRecord(self, dom):
     try:
         results = dom.select(self.flags["search_query"])
     except SDBResponseError as error:
         aws_print_error(error)
     results_yn = 0  # this is in case there are no results, don't know why this isn't built in.
     for result in results:
         results_yn = 1
         print makeover(result, self.flags["is_monochrome"])
     if results_yn == 1:
         if self.flags["is_monochrome"] == False:
             print colorize("gray", "========================================", 0)
         else:
             print "========================================"
     return True
Ejemplo n.º 2
0
 def remEntry(self, dom):
     try:
         dom.delete_attributes(self.flags["search_term"])
     except SDBResponseError as error:
         aws_print_error(error)
     output = colorize("green", "Log entry deleted successfully.")
     print output
     return True
Ejemplo n.º 3
0
 def logEntry(self, dom):
     output = ""
     entry = self.flags["entry_text"]
     if self.flags["is_complete"] == True:
         entry += " #complete"
         output += colorize("cyan", "Completed a task, way to go!", 1)
     if self.flags["is_default"] == True:
         entry += " #" + config.values["default"]
     the_id = uuid4()
     entry = entry.replace("\\", "")
     entry_dict = {"entry": entry, "date": strftime("%Y-%m-%dT%H:%M:%S+0000", localtime())}
     try:
         dom.put_attributes(the_id, entry_dict)
         self.add_tags(dom, the_id, entry)
     except SDBResponseError as error:
         aws_print_error(error)
     output += colorize("gray", "Entry: " + entry, 1)
     output += colorize("green", "Log entry submitted successfully.")
     print output
     return True