Esempio n. 1
0
def start_gui(check_wakeup):
    global logger

    console.show_activity("Scanning repositories...")
    if check_wakeup:
        logger.info("Checking if wakeup is required...")

    sync_tools = []
    configs = sync.find_sync_configs()
    working_copy_configs = []
    working_copy_configs.extend(filter(lambda config: config.repository.working_copy_wakeup, configs))
    working_copy_active = ENABLE_WORKING_COPY_SUPPORT and len(working_copy_configs) > 0

    if working_copy_active and check_wakeup:
        wakeup_webdav_server(working_copy_configs[0])
        logger.info("Exiting to await callback from Working Copy...")
        console.hide_activity()
        return

    logger.info("Starting GUI...")

    for config in configs:
        logger.info("Found configuration '%s'..." % config.repository.name)

        try:
            sync_tool = sync.SyncTool(config)
            sync_tools.append(sync_tool)

        except Exception as e:
            logger.exception("Error '%s' while processing configuration '%s'" % (str(e), config.repository.name))

    selector = sync_selector.SyncSelector()
    console.hide_activity()
    selector.select(sync_tools, working_copy_active=working_copy_active)
Esempio n. 2
0
def start_gui(check_wakeup):
  
  global logger
  
  sync_tools = []
  configs = sync.find_sync_configs()
  working_copy_configs = filter(lambda config:config.repository.working_copy_wakeup, configs)
  
  if len(working_copy_configs) > 0 and check_wakeup:
    wakeup_webdav_server(working_copy_configs[0].webdav)
    logger.info("Exiting to await callback from Working Copy...")
    return 
    
  logger.info("Starting GUI...")
  for config in configs:
    
    logger.info("Found configuration '%s'..." % config.repository.name)
    
    try:
      
      sync_tool = sync.SyncTool(config)
      #sync_tool.scan()
      sync_tools.append(sync_tool)
      
    except Exception as e:
      
      logger.info("Error '%s' while processing configuration '%s'" % ( str(e), config.repository.name) )
    
  selector = sync_selector.SyncSelector()
  
  selector.select(sync_tools)