예제 #1
0
def checkinmode():
    """The checkin screen"""
    clear()
    ui.chk()
    iny = raw_input("NAME:   ")
    if iny == ":EXIT": checkpremenu()
    else: pass

    def markin(uid):
        db.checkin(uid)

    try:
        x = db.osearch("name", iny)
        if chky(x.id) is False:
            markin(x.id)
            ui.ok()
            time.sleep(1)
            checkinmode()
        elif chky(x.id) is True:
            ui.chkold()
            time.sleep(1)
            checkinmode()
        else:  #@error 003
            ui.err("#003")
            time.sleep(1)
            checkinmode()
    except AttributeError:  #@Error 001
        ui.fail()
        time.sleep(1)
        checkinmode()
예제 #2
0
파일: main.py 프로젝트: b1naryth1ef/Checkin
def checkinmode():
	"""The checkin screen"""
	clear()
	ui.chk()
	iny = raw_input("NAME:   ")
	if iny == ":EXIT": home()
	else: pass
	def markin(uid):
		db.checkin(uid)
	try:
		x = db.osearch("name",iny)
		if chky(x.id) is False:
			markin(x.id)
			ui.ok()
			time.sleep(1)
			checkinmode()
		elif chky(x.id) is True:
			ui.chkold()
			time.sleep(1)
			checkinmode()
		else:	#@error 003
			ui.err("#003")
			time.sleep(1)
			checkinmode()
	except AttributeError: #@Error 001
		ui.fail()
		time.sleep(1)
		checkinmode()
예제 #3
0
파일: main.py 프로젝트: harryd/Checkin
def checkinmode():
	clear()
	ui.chk()
	iny = raw_input("NAME:   ")
	if iny == ":EXIT":
		home()
	else:
		pass
	def markin(uid):
		db.checkin(uid)
	try:
		x = db.find_user("name",iny)
		if chky(x.id) is False:
			markin(x.id)
			ui.ok()
			time.sleep(1)
			checkinmode()
		elif chky(x.id) is True:
			ui.chkold()
			time.sleep(1)
			checkinmode()
		else:	#@error 003
			ui.err("#003")
			time.sleep(1)
			checkinmode()
	except AttributeError: #@Error 001
		ui.fail()
		time.sleep(1)
		checkinmode()
	except: #@error 002
		#print sys.exc_info()[0]
		ui.err("#002")
		time.sleep(1)
		sys.exit()
예제 #4
0
    def execute_command(self):
        """
        Execute the shell command.
        """
        stderr = ""
        role_count = 0
        for role in utils.roles_dict(self.roles_path):
            self.command = self.command.replace("%role_name", role)
            (_, err) = utils.capture_shell("cd {0} && {1}".format(
                os.path.join(self.roles_path, role), self.command))

            stderr = err
            role_count += 1

        utils.exit_if_no_roles(role_count, self.roles_path)

        if len(stderr) > 0:
            ui.error(c.MESSAGES["run_error"], stderr[:-1])
        else:
            if not self.config["options_quiet"]:
                ui.ok(
                    c.MESSAGES["run_success"].replace("%role_count",
                                                      str(role_count)),
                    self.options.command)
예제 #5
0
    def execute_command(self):
        """
        Execute the shell command.
        """
        stderr = ""
        role_count = 0
        for role in utils.roles_dict(self.roles_path):
            self.command = self.command.replace("%role_name", role)
            (_, err) = utils.capture_shell("cd {0} && {1}".
                                           format(os.path.join(
                                                  self.roles_path, role),
                                                  self.command))

            stderr = err
            role_count += 1

        utils.exit_if_no_roles(role_count, self.roles_path)

        if len(stderr) > 0:
            ui.error(c.MESSAGES["run_error"], stderr[:-1])
        else:
            if not self.config["options_quiet"]:
                ui.ok(c.MESSAGES["run_success"].replace(
                    "%role_count", str(role_count)), self.options.command)
예제 #6
0
"""
XBMC DVD Manager
by Steven J. Burch, AsylumFunk.com

For more information, fire up README.txt
To see what's been changing, check out changelog.xml
"""

#Project modules
import ui

if ui.lang.isSupported():
	ui.displayMainMenu()
else:
	ui.ok( "Error", "We were unable to ititialize the script.", "The script will now close.", "If the problem persists, please reinstall the script." )
예제 #7
0
"""
XBMC DVD Manager
by asylumfunk, http://github.com/asylumfunk

For more information, fire up README.txt
To see what's been changing, check out changelog.xml
"""

import os
import sys
import xbmcaddon

__addon__ = xbmcaddon.Addon('script.dvdmanager')
__scriptname = __addon__.getAddonInfo('name')
__path__ = __addon__.getAddonInfo('path')
__resources__ = os.path.join(__path__, 'resources')
__lib__ = os.path.join(__resources__, 'lib')

sys.path.append(__lib__)

#Project modules
import ui

if __name__ == '__main__':
    if ui.lang.isSupported():
        ui.displayMainMenu()
    else:
        ui.ok("Error", "We were unable to ititialize the script.",
              "The script will now close.",
              "If the problem persists, please reinstall the script.")