def main(): options, _ = zarafa.parser().parse_args() server = zarafa.Server(options) # TODO: use optparse to figure this out? if not server.options.auth_user: print 'No user specified' if not server.options.folders: print 'No folder specified' else: user = zarafa.Server().user(server.options.auth_user) folder = user.store.folders().next() # First Folder print 'Monitoring folder %s of %s for update and delete events' % ( folder, user.fullname) # Create mapping for item in folder.items(): ITEM_MAPPING[item.sourcekey] = item print 'Mapping of items and sourcekey complete' folder_state = folder.state new_state = folder.sync(Importer(), folder_state) # from last known state while True: new_state = folder.sync(Importer(), folder_state) # from last known state if new_state != folder_state: folder_state = new_state time.sleep(1)
def opt_args(): parser = zarafa.parser('skpcubeC') parser.add_option("--all", dest="all", action="store_true", default=False, help="run program for all users") parser.add_option("--autoremove", dest="autoremove", action="store_true", default=False, help="remove infected attachments") return parser.parse_args()
def opt_args(): parser = zarafa.parser('skpc') parser.add_option('--save', dest='save', action='store', help='Save plot to file (png)') return parser.parse_args()
def opt_args(): parser = zarafa.parser('skpc') parser.add_option('--system', dest='system', action='store_true', help='Gives information about threads, SQL and caches') parser.add_option( '--users', dest='users', action='store_true', help='Gives information about users, store sizes and quotas') parser.add_option( '--company', dest='company', action='store_true', help='Gives information about companies, company sizes and quotas') parser.add_option('--servers', dest='servers', action='store_true', help='Gives information about cluster nodes') parser.add_option('--top', dest='top', action='store_true', help='Shows top-like information about sessions') parser.add_option('-d', '--dump', dest='dump', action='store_true', help='print output as csv') return parser.parse_args()
def opt_args(help): parser = zarafa.parser('skpc') parser.add_option( '--user', dest='user', action='store', help='User for which you want to do Out of Office actions') parser.add_option('--subject', dest='subject', action='store', help='Subject of the Out of Office e-mail') parser.add_option('--message', dest='message', action='store', help='Message of the Out of Office e-mail') parser.add_option('--mode', dest='mode', action='store', help='Enable or Disable Out of Office') parser.add_option('--start', dest='start', action='store', help='Start date / time') parser.add_option('--end', dest='end', action='store', help='End date / time') if help: parser.print_help() else: return parser.parse_args()
def opt_args(): parser = zarafa.parser('msvkpcuC') parser.add_option("--all", dest="all", action="store_true", default=False, help="run program for all users") parser.add_option("--after", dest="after", type=int, default=None , action="store", help="delete from \'Deleted Items\' after x amount of days") return parser.parse_args()
def opt_args(): parser = zarafa.parser() parser.add_option('--file', dest='ics', action='store', help='File to import') return parser.parse_args()
def opt_args(): parser = zarafa.parser('skpcufm') parser.add_option('-v', '--verbose', dest='verbose', action='store_true', help='enable verbose mode') return parser.parse_args()
def opt_args(): parser = zarafa.parser('skpc') parser.add_option('--store', dest='store', action='store_true', help='Plots a graph with store sizes of users') parser.add_option('--folders', dest='plotfolders', action='store_true', help='Plots a graph with the number of folders per user') parser.add_option('--items', dest='items', action='store_true', help='Plots a graph with the number of items per user') parser.add_option('--save', dest='save', action='store', help='Save plot to file (png)') parser.add_option('--sort', dest='sort', action='store_true', help='Sort the graph') return parser.parse_args()
def opt_args(): parser = zarafa.parser('skpcfm') parser.add_option("--user", dest="user", action="store", help="Run script for user") parser.add_option("--foldername", dest="foldername", action="store", help="name of the folder") parser.add_option("--type", dest="Type", action="store", help="""type the store Appointment, Journal, Task, Contacts, Note or Drafts""") return parser.parse_args()
def main(): parser = zarafa.parser('ckpsF') # select common cmd-line options parser.add_option('-r', '--reindex', dest='reindex', action='append', default=[], help='Reindex user/store', metavar='USER') options, args = parser.parse_args() service = Service('search', config=CONFIG, options=options) if options.reindex: service.reindex() else: service.start()
def opt_args(): parser = zarafa.parser('skpc') parser.add_option('--system', dest='system', action='store_true', help='Gives information about threads, SQL and caches') parser.add_option('--users', dest='users', action='store_true', help='Gives information about users, store sizes and quotas') parser.add_option('--company', dest='company', action='store_true', help='Gives information about companies, company sizes and quotas') parser.add_option('--servers', dest='servers', action='store_true', help='Gives information about cluster nodes') parser.add_option('--top', dest='top', action='store_true', help='Shows top-like information about sessions') parser.add_option('-d','--dump', dest='dump', action='store_true', help='print output as csv') return parser.parse_args()
def opt_args(help): parser = zarafa.parser('skpc') parser.add_option('--user', dest='user', action='store', help='User for which you want to do Out of Office actions') parser.add_option('--subject', dest='subject', action='store', help='Subject of the Out of Office e-mail') parser.add_option('--message', dest='message', action='store', help='Message of the Out of Office e-mail') parser.add_option('--mode', dest='mode', action='store', help='Enable or Disable Out of Office') if help: parser.print_help() else: return parser.parse_args()
def opt_args(): parser = zarafa.parser('skpcfm') parser.add_option("--user", dest="user", action="store", help="Run script for user") parser.add_option("--wastebasket", dest="wastebasket", action="store_true", help="Run cleanup script for the wastebasket folder") parser.add_option("--junk", dest="junk", action="store_true", help="Run cleanup script for the junk folder") parser.add_option("--force", dest="force", action="store_true", help="Force items without date to be removed") parser.add_option("--days", dest="days", action="store", help="Delete older then x days") parser.add_option("--verbose", dest="verbose", action="store_true", help="Verbose mode") parser.add_option("--dry-run", dest="dryrun", action="store_true", help="Run script in dry mode") parser.add_option("--progressbar", dest="progressbar", action="store_true", help="Show progressbar ") return parser.parse_args()
def opt_args(): parser = zarafa.parser('skpcfm') parser.add_option("--user", dest="user", action="store", help="Run script for user") parser.add_option("--foldername", dest="foldername", action="store", help="name of the folder") parser.add_option("--type", dest="Type", action="store", help="""type the store Appointment, Journal, Task, Contacts, Note or Drafts""" ) return parser.parse_args()
def opt_args(): parser = zarafa.parser("skpc") parser.add_option( "--system", dest="system", action="store_true", help="Gives information about threads, SQL and caches" ) parser.add_option( "--users", dest="users", action="store_true", help="Gives information about users, store sizes and quotas" ) parser.add_option( "--company", dest="company", action="store_true", help="Gives information about companies, company sizes and quotas", ) parser.add_option("--servers", dest="servers", action="store_true", help="Gives information about cluster nodes") parser.add_option("--top", dest="top", action="store_true", help="Shows top-like information about sessions") parser.add_option("-d", "--dump", dest="dump", action="store_true", help="print output as csv") return parser.parse_args()
def main(): global nr_error options, args = zarafa.parser('cskpUPmvu').parse_args() server = zarafa.Server() if len(args) == 1 and os.path.isdir(args[0]): data = [] for filename in sorted(glob.glob(args[0]+'/*/account.settings')): print 'ACCOUNT:', filename data.append(('{\nRealName = "%s";\n' % filename.split(os.path.sep)[-2])+file(filename).read()+'\n}') elif args: data = [file(arg).read() for arg in args] else: data = [TEST_ACCOUNT] for d in data: try: account = cgon.loads(d.strip()) process_account(account, server, options) except Exception, e: print traceback.format_exc(e) nr_error += 1
def main(): global nr_error options, args = zarafa.parser('cskpUPmvu').parse_args() server = zarafa.Server() if len(args) == 1 and os.path.isdir(args[0]): data = [] for filename in sorted(glob.glob(args[0] + '/*/account.settings')): print 'ACCOUNT:', filename data.append(('{\nRealName = "%s";\n' % filename.split(os.path.sep)[-2]) + file(filename).read() + '\n}') elif args: data = [file(arg).read() for arg in args] else: data = [TEST_ACCOUNT] for d in data: try: account = cgon.loads(d.strip()) process_account(account, server, options) except Exception, e: print traceback.format_exc(e) nr_error += 1
def main(): options, _ = zarafa.parser().parse_args() server = zarafa.Server(options) # TODO: use optparse to figure this out? if not server.options.auth_user: print 'No user specified' if not server.options.folders: print 'No folder specified' else: user = zarafa.Server().user(server.options.auth_user) folder = user.store.folders().next() # First Folder print 'Monitoring folder %s of %s for update and delete events' % (folder, user.fullname) # Create mapping for item in folder.items(): ITEM_MAPPING[item.sourcekey] = item print 'Mapping of items and sourcekey complete' folder_state = folder.state new_state = folder.sync(Importer(), folder_state) # from last known state while True: new_state = folder.sync(Importer(), folder_state) # from last known state if new_state != folder_state: folder_state = new_state time.sleep(1)
def opt_args(): parser = zarafa.parser() return parser.parse_args()
def opt_args(): parser = zarafa.parser('skpcfUP') return parser.parse_args()
import zarafa options, args = zarafa.parser('skpmcuf').parse_args() assert args, 'please specify search pattern' for user in zarafa.Server().users(parse=True): print "Running for user:"******"Folder:", folder.name for item in folder.items(): if args[0].lower() in item.subject.lower(): print "Deleting:", item if options.modify: folder.delete([item])
def opt_args(): parser = zarafa.parser("skpcuf") parser.add_option("--move", dest="move", action="store_true", help="attempt to move broken ipm_subtree into zarafa restored folders") parser.add_option("--dry-run", dest="dryrun", action="store_true", help="run the script without executing any actions") return parser.parse_args()