예제 #1
0
def main():
    pic = pig()
    print("===================================")
    print("Welcome to Multi-View Program")
    print("1 : show 3D model")
    print("2 : show Multi-View")
    print("Press others numbers key to exit")
    print("===================================")

    #check if input is not number user have to input again
    while True:
        try:
            userin = int(input("select > "))
            break
        except ValueError:
            print("Invalid input : Please Input Number")

    #input is 1 -> draw 3D
    if userin == 1:
        d3 = Draw3D(pic.edges, pic.verticies)
        d3.show3D()
    #input is 2 -> draw multiview
    elif userin == 2:
        d2 = Draw2D(pic.edges, pic.verticies, pic.surfaces)
        d2.show2D()
    #input is any number exit program
    else :
        print("Exit Program")
예제 #2
0
 def configure(self, env):
     import params
     env.set_params(params)
     pig()
예제 #3
0
 def configure(self, env):
   import params
   env.set_params(params)
   pig()
예제 #4
0
import sys
from optparse import OptionParser

from pig import pig, get_jobflow_id

if __name__ == "__main__":
    parser = OptionParser(usage="%prog [-n JOBFLOW_NAME] [-j JOBFLOW_ID] SCRIPT PARAMS", description="Runs a Pig job in the Elastic MapReduce jobflow with the given JOBFLOW_NAME or JOBFLOW_ID. If both are specified, uses JOBFLOW_ID. If neither are specified, throws an error. PARAMS should be '='-delimited Pig params only (i.e. ... LOGS=logs/20091202 OUT=s3://my.output/job-output")
    parser.add_option("-j", "--jobflow-id", dest="jobflow_id", help="Runs SCRIPT in the jobflow with this ID.")
    parser.add_option("-n", "--jobflow-name", dest="jobflow_name", help="Runs SCRIPT in the jobflow with this name.")
    options, args = parser.parse_args()

    script = args[0]
    params = args[1:]
    params = dict([param.split('=') for param in params])

    if options.jobflow_id:
        pig(script, option.jobflow_id, **params)
    elif options.jobflow_name:
        pig(script, get_jobflow_id(options.jobflow_name), **params)
    else:
        parser.print_help()
        parser.error("Either -n or -j have to be specified.")