comparison sqlpyPlus.py @ 58:de6278a3bf53

adding compare help
author catherine@cordelia
date Wed, 02 Apr 2008 21:29:36 -0400
parents 4931f32c8ff5
children 4f80329a1905 1eefe17b3630
comparison
equal deleted inserted replaced
57:4931f32c8ff5 58:de6278a3bf53
380 380
381 def do_shortcuts(self,arg): 381 def do_shortcuts(self,arg):
382 """Lists available first-character shortcuts 382 """Lists available first-character shortcuts
383 (i.e. '!dir' is equivalent to 'shell dir')""" 383 (i.e. '!dir' is equivalent to 'shell dir')"""
384 for (scchar, scto) in self.shortcuts.items(): 384 for (scchar, scto) in self.shortcuts.items():
385 self.stdout.write('%s: %s\n') % (scchar, scto) 385 print '%s: %s' % (scchar, scto)
386 386
387 def colnames(self): 387 def colnames(self):
388 return [d[0] for d in curs.description] 388 return [d[0] for d in curs.description]
389 389
390 def sql_format_itm(self, itm, needsquotes): 390 def sql_format_itm(self, itm, needsquotes):
647 print 'Results written to %s' % os.path.join(os.getcwd(), fname) 647 print 'Results written to %s' % os.path.join(os.getcwd(), fname)
648 648
649 def do_compare(self, args): 649 def do_compare(self, args):
650 """COMPARE query1 TO query2 - uses external tool to display differences. 650 """COMPARE query1 TO query2 - uses external tool to display differences.
651 651
652 Sorting is recommended to avoid false hits.""" 652 Sorting is recommended to avoid false hits.
653 Will attempt to use a graphical diff/merge tool like kdiff3, meld, or Araxis Merge,
654 if they are installed."""
653 fnames = [] 655 fnames = []
654 args2 = args.split(' to ') 656 args2 = args.split(' to ')
655 for n in range(len(args2)): 657 for n in range(len(args2)):
656 query = args2[n] 658 query = args2[n]
657 fnames.append('compare%s.txt' % n) 659 fnames.append('compare%s.txt' % n)