Esempio n. 1
0
 def setUp(self):
     self._admin = console.LzsAdmin()
     self._admin.curdir = tempfile.gettempdir()
     self.mywps = os.path.join(tempfile.gettempdir(), '.lazyscripts')
     env.register_workspace(self.mywps)
     self.upspoolname = os.path.join(tempfile.gettempdir(), 'upstreampool')
     pool.init_gitpool_bare(self.upspoolname)
Esempio n. 2
0
 def setUp(self):
     self._admin = console.LzsAdmin()
     self._admin.curdir = tempfile.gettempdir()
     self.mywps = os.path.join(tempfile.gettempdir(), ".lazyscripts")
     env.register_workspace(self.mywps)
     self.upspoolname = os.path.join(tempfile.gettempdir(), "upstreampool")
     pool.init_gitpool_bare(self.upspoolname)
Esempio n. 3
0
 def setUp(self):
     self.mywps = os.path.join(tempfile.gettempdir(), '.lazyscripts')
     env.register_workspace(self.mywps)
     self.runner = lzsrunner.ScriptsRunner()
     self.scriptname = os.path.join(tempfile.gettempdir(), 'script4testrunner')
     self.poolname = os.path.join(tempfile.gettempdir(), 'pool4testrunner')
     os.mkdir(self.poolname)
Esempio n. 4
0
 def test_resource_name(self):
     mywps = os.path.join(tempfile.gettempdir(), '.lazyscripts')
     env.register_workspace(mywps)
     self.assertEquals(mywps, env.resource_name())
     self.assertEquals(
         os.path.join(mywps, 'config'),
         env.resource_name('config'))
     shutil.rmtree(mywps)
Esempio n. 5
0
 def setUp(self):
     self.mywps = os.path.join(tempfile.gettempdir(), '.lazyscripts')
     env.register_workspace(self.mywps)
     self.runner = lzsrunner.ScriptsRunner()
     self.scriptname = os.path.join(tempfile.gettempdir(),
                                    'script4testrunner')
     self.poolname = os.path.join(tempfile.gettempdir(), 'pool4testrunner')
     os.mkdir(self.poolname)
Esempio n. 6
0
def run(args=None):
    if not args:
        args = sys.argv[1:]

    argc = len(args)
    if argc < 1:
        print "USAGE:\n\t...TBD..."
        sys.exit()

    env.register_workspace()
    env.prepare_runtimeenv()

    admin = LzsAdmin()
    admin.onecmd(" ".join(args))
Esempio n. 7
0
def gui_run():
    from lazyscripts import wm
    if os.getuid() == 0:
        print _('console.gui_run.dont_run_as_root')
        sys.exit()

    env.register_workspace()
    env.prepare_runtimeenv()
    env.storageenv()
    dist = distro.Distribution().name
    if not dist:
        print _('console.gui_run.distro_is_not_supported')
        sys.exit()

    message_sudo= _('console.gui_run.gksu_msg')
    # prefix = 'gksu --message %s' % message_sudo

    # argument process.
    parser = optparse.OptionParser()
    parser.add_option("-a", "--autosync",
		action="store_true",
                  dest="autosync",
                  default=False,
                  help="sync scripts pool automatically")
    parser.add_option("-s", "--selection",
                  dest="selection_list")
    parser.add_option("-r", "--rev",
                  dest="rev")
    (options, args) = parser.parse_args()

    if options.autosync:
      if not options.rev:
          cmd = "lzs pool sync"
      else:
          cmd = "lzs pool sync --rev %s" % options.rev

      ui.show_progress(cmd,
                        'Lazyscripts',
                        _('console.gui_run.downloading_scripts'),
                        80,
                        400,
                        True,
                        True)

    if options.selection_list:
        cmd = "lzs gui run %s" % options.selection_list
    else:
        cmd = "lzs gui run"
    gui_cmd = wm.WindowManager().make_guisudocmd(cmd, message_sudo)
    os.system(gui_cmd)
Esempio n. 8
0
def gui_run():
    from lazyscripts import wm
    if os.getuid() == 0:
        print _('console.gui_run.dont_run_as_root')
        sys.exit()

    env.register_workspace()
    env.prepare_runtimeenv()
    env.storageenv()
    dist = distro.Distribution().name
    if not dist:
        print _('console.gui_run.distro_is_not_supported')
        sys.exit()

    message_sudo= _('console.gui_run.gksu_msg')
    # prefix = 'gksu --message %s' % message_sudo

    # argument process.
    parser = optparse.OptionParser()
    parser.add_option("-a", "--autosync",
		action="store_true",
                  dest="autosync",
                  default=False,
                  help="sync scripts pool automatically")
    parser.add_option("-s", "--selection",
                  dest="selection_list")
    parser.add_option("-r", "--rev",
                  dest="rev")
    (options, args) = parser.parse_args()

    if options.autosync:
      if not options.rev:
          cmd = "lzs pool sync"
      else:
          cmd = "lzs pool sync --rev %s" % options.rev

      ui.show_progress(cmd,
                        'Lazyscripts',
                        _('console.gui_run.downloading_scripts'),
                        80,
                        400,
                        True,
                        True)

    if options.selection_list:
        cmd = "lzs gui run %s" % options.selection_list
    else:
        cmd = "lzs gui run"
    gui_cmd = wm.WindowManager().make_guisudocmd(cmd, message_sudo)
    os.system(gui_cmd)
Esempio n. 9
0
def run(args=None):
    if not args:
        args = sys.argv[1:]

    argc = len(args)
    if argc < 1:
        print "USAGE:\n\t...TBD..."
        sys.exit()

    env.register_workspace()
    env.prepare_runtimeenv()

    admin = LzsAdmin()
    admin.onecmd(' '.join(args))