~xubuntu-dev/ubiquity/lp1437180_feh

« back to all changes in this revision

Viewing changes to bin/ubiquity-dm

  • Committer: Dmitrijs Ledkovs
  • Date: 2013-10-18 21:55:34 UTC
  • Revision ID: dmitrijs.ledkovs@canonical.com-20131018215534-32wy6whpv8ry946j
Don't read proc_cmdline twice (LP: #1213748)

Show diffs side-by-side

added added

removed removed

Lines of Context:
426
426
                        preexec_fn=self.drop_privileges)
427
427
 
428
428
            # Accessibility infrastructure
 
429
            proc_cmdline = []
429
430
            with open('/proc/cmdline', 'r') as fp:
430
 
                if (accessibility or 'maybe-ubiquity' in fp.readline() or
431
 
                        'only-ubiquity' in fp.readline() or
432
 
                        program_basename == 'oem-config-wrapper'):
433
 
                    launcher = '/usr/lib/at-spi2-core/at-spi-bus-launcher'
434
 
                    if os.path.exists(launcher):
435
 
                        extras.append(subprocess.Popen(
436
 
                            [launcher, '--launch-immediately'],
437
 
                            stdin=null, stdout=logfile, stderr=logfile,
438
 
                            preexec_fn=self.drop_privileges))
439
 
                        os.environ['GTK_MODULES'] += os.pathsep + 'gail'
 
431
                proc_cmdline = fp.readline().split()
 
432
                
 
433
            if (accessibility or 'maybe-ubiquity' in proc_cmdline or
 
434
                    'only-ubiquity' in proc_cmdline or
 
435
                    program_basename == 'oem-config-wrapper'):
 
436
                launcher = '/usr/lib/at-spi2-core/at-spi-bus-launcher'
 
437
                if os.path.exists(launcher):
 
438
                    extras.append(subprocess.Popen(
 
439
                        [launcher, '--launch-immediately'],
 
440
                        stdin=null, stdout=logfile, stderr=logfile,
 
441
                        preexec_fn=self.drop_privileges))
 
442
                    os.environ['GTK_MODULES'] += os.pathsep + 'gail'
440
443
 
441
444
            if osextras.find_on_path('gnome-shell'):
442
445
                wm_cmd = ['gnome-shell', '--sm-disable', '--mode=ubiquity']