Ciaran Farrell avatar Ciaran Farrell committed e331432

Add stubs and help text for create action

Comments (0)

Files changed (1)

 list command'''
 help_busy='''By entering the email addresses of Groupwise users you can query
 their availability. This is known as a 'busy search' in Groupwise itself'''
+help_message = '''The message is the body of the appointment. Groupwise will
+attach this as the first attachment to the item. Use this to type longer texts
+and to include e.g. dial-in details. Note that text entered here will not be
+shown in the summary list view (only the subject is shown there)'''
+help_subject = '''Analog to the subject of an email - use this field to enter
+a short, concise description of the event. This field is shown in the main list
+overview of appointments'''
+help_cc = '''Analog to cc recipients of an email. All cc recipients can see who
+the 'to' recipients as well as the other cc recipients are'''
+help_place = '''If the appointment is taking place at a particular place, enter
+the place here. Groupwise reserves this field specially - i.e. it is not simply
+a free text addition'''
+help_begin = '''Start time of the appointment using ISO format YYYY-MM-DD HH:MM
+where HH:MM is the hours and minutes in 24 hour format'''
+help_end = '''End time of the appointment using ISO format YYYY-MM-DD HH:MM
+where HH:MM is the hours and minutes in 24 hour format'''
+help_to = '''Analog to the 'to' recipients of an email. All to recipients can
+see who the other 'to' recipients as well as the other cc recipients are'''
 parser = argparse.ArgumentParser(parents=[parentparser],
           description=termine_desc,
           prog=termine_prog)
 tshow.add_argument('id', nargs='?', help=help_show)
 tbusy = subparsers.add_parser('busy', help='Perform a busy search')
 tbusy.add_argument('recip', nargs='*', help=help_busy)
+tcreate = subparsers.add_parser('create', help='Create and send an appointment')
+tcreate.add_argument('-m','--message',dest='message',help=help_message,
+                    default=None)
+tcreate.add_argument('-s','--subject',dest='subject',help=help_subject,
+                    default=None)
+tcreate.add_argument('-c','--cc',dest='cc',help=help_cc,
+                    default=None)
+tcreate.add_argument('-p','--place',dest='place',help=help_place,
+                    default=None)                    
+tcreate.add_argument('-b','--begin',dest='begin',help=help_begin,
+                    default=None)                    
+tcreate.add_argument('-e','--end',dest='end',help=help_end,
+                    default=None)                    
+
+tcreate.add_argument('to', nargs='*', help=help_to)
 
 args = parser.parse_args()
 
 elif hasattr(args,'recip'):
   logger.debug('parsed recip to be %s'%args.recip)
   action = 'busy'
+elif hasattr(args,'to'):
+  logger.debug('parsed to to be %s'%args.to)
+  action = 'create'
 else:
   # this will probably never be reached as the parser will catch the error
   parser.error('Could not determine whether you want to show or list')
       else:
         view.render()
         ok=True
+  elif action == 'create':
+    logger.debug('action is create')
+    print "NOT IMPLEMENTED - COME BACK LATER"
+    ok = True
   elif action == 'busy':
     logger.debug('action is busy')
     try:
       else:
         who = []
         for recip in args.recip:
-          if '@' in recip:
-            logger.warn('Detected email address style user %s. Stripping...'%recip)
-            who.append(recip.split('@')[0])
-          else:
-            who.append(recip)
+          #if '@' in recip:
+          #  logger.warn('Detected email address style user %s. Stripping...'%recip)
+          #  who.append(recip.split('@')[0])
+          #else:
+          who.append(recip)
       if not len(who): # TODO: perhaps get _this_ user's busy times?
         sys.stderr.write('You need to provide at least one user to busy search\n')
         sys.exit(1)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.