old_contents: #!/usr/bin/python
  import sys, os
  import ConfigParser, argparse
  
  sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
  import pre
  
  
  # config files
  config = ConfigParser.SafeConfigParser()
  config.read('pre.cfg')
  
  url       = config.get('pre', 'Url')
  accesskey = config.get('pre', 'Accesskey')
  verify    = config.get('pre', 'VerifyCertificate')
  
  
  # command line args
  parser = argparse.ArgumentParser(description="Query Pre.im for releases")
  parser.add_argument('-q', '--query', metavar='q', required=True, help='The query to search for (required)')
  parser.add_argument('-g', '--group', metavar='g', help='Filter results by group name')
  parser.add_argument('-s', '--section', metavar='s', help='Search within a section, example: "mp3"')
  parser.add_argument('-l', '--limit', metavar='n', type=int, default=10, help='Show N number of releases')
  parser.add_argument('-e', '--deleted', action='store_true', help='edupe - Include deleted releases')
  parser.add_argument('-r', '--oldest', action='store_true', help='rdupe - Search for the oldest releases')
  
  args = parser.parse_args()
  
  
  # query
  r = pre.Releases(url, accesskey, verify)
  
  releases = None
  
  if args.deleted:
      releases = r.edupe(args.query, section=args.section, group=args.group, limit=args.limit)
  elif args.oldest:
      releases = r.rdupe(args.query, section=args.section, group=args.group, limit=args.limit)
  else:
      releases = r.dupe(args.query, section=args.section, group=args.group, limit=args.limit)
  
  print releases
  
new_contents: #!/usr/bin/python
  import sys, os
  import ConfigParser, argparse
  import datetime
  
  sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
  import pre
  
  
  # config files
  config = ConfigParser.SafeConfigParser()
  config.read('pre.cfg')
  
  url       = config.get('pre', 'Url')
  accesskey = config.get('pre', 'Accesskey')
  verify    = config.get('pre', 'VerifyCertificate')
  
  
  # command line args
  parser = argparse.ArgumentParser(description="Query Pre.im for releases")
  parser.add_argument('-q', '--query', metavar='q', required=True, help='The query to search for (required)')
  parser.add_argument('-g', '--group', metavar='g', help='Filter results by group name')
  parser.add_argument('-s', '--section', metavar='s', help='Search within a section, example: "mp3"')
  parser.add_argument('-l', '--limit', metavar='n', type=int, default=10, help='Show N number of releases')
  parser.add_argument('-e', '--deleted', action='store_true', help='edupe - Include deleted releases')
  parser.add_argument('-r', '--oldest', action='store_true', help='rdupe - Search for the oldest releases')
  
  args = parser.parse_args()
  
  
  # query
  r = pre.Releases(url, accesskey, verify)
  
  releases = None
  
  if args.deleted:
      releases = r.edupe(args.query, section=args.section, group=args.group, limit=args.limit)
  elif args.oldest:
      releases = r.rdupe(args.query, section=args.section, group=args.group, limit=args.limit)
  else:
      releases = r.dupe(args.query, section=args.section, group=args.group, limit=args.limit)
  
  for i in releases:
      time = datetime.datetime.fromtimestamp(i['time'])
      print "[PRE/{0:<10}] {1} [F{2}/{3}MB] [{4}]".format(i['section'], i['release'], i['files'], i['size'], time)
  
subject: format dupe output