Esempio n. 1
0
def                     robot():
  path = None
  link = None
  name = None

  # display.
  env.display(env.HEADER_OK,
              "generating the robot's capability",
              env.OPTION_NONE)

  # retrieve the server's code.
  code = ktp.code.Load(env._TEST_STORE_CODE_DIR_ + "/server" +          \
                         ktp.code.Extension)

  # compute the name.
  name = "robot"

  # compute the file name.
  path = env._TEST_STORE_CAPABILITY_DIR_ + "/" +                        \
    name + ktp.capability.Extension

  # compute the link.
  link = env._PROFILE_DIR_ + "/user/robot/robot" + ktp.capability.Extension

  # create the capability.
  capability = ktp.capability.Create(code,
                                     name,
                                     ktp.capability.TypeStudent,
                                     {},
                                     [ { "name":
                                           "Robot",
                                         "email":
                                           "*****@*****.**",
                                         "login":
                                           "******"
                                         } ])

  # store it.
  ktp.capability.Store(path,
                       capability)

  # remove the previous link.
  env.remove(link, env.OPTION_NONE)

  # create a link from the profile. XXX[this could probably be improved]
  env.link(link,
           "../../../../test/store/capability/" + name +                
             ktp.capability.Extension,
           env.OPTION_NONE)

  # display.
  env.display(env.HEADER_OK,
              "the robot's capability has been generated succesfully",
              env.OPTION_NONE)
Esempio n. 2
0
def                     contributor():
  path = None
  link = None
  name = None

  # display.
  env.display(env.HEADER_OK,
              "generating a contributor's capability",
              env.OPTION_NONE)

  # retrieve the server's code.
  code = ktp.code.Load(env._TEST_STORE_CODE_DIR_ + "/server" +          \
                         ktp.code.Extension)

  # compute the name.
  name = env._USER_

  # compute the file name.
  path = env._TEST_STORE_CAPABILITY_DIR_ + "/" +                        \
    name + ktp.capability.Extension

  # compute the link.
  link = env._TEST_CAPABILITY_

  # create the capability.
  capability = ktp.capability.Create(code,
                                     name,
                                     ktp.capability.TypeContributor,
                                     {},
                                     [ { "name": env._TEST_NAME_,
                                         "email": env._TEST_EMAIL_,
                                         "login":
                                           env._TEST_NAME_.lower().
                                             replace(" ", ".") } ])

  # store it.
  ktp.capability.Store(path,
                       capability)

  # remove the previous link.
  env.remove(link, env.OPTION_NONE)

  # create a link from the profile. XXX[this could probably be improved]
  env.link(link,
           "../../../../test/store/capability/" + name +                
             ktp.capability.Extension,
           env.OPTION_NONE)

  # display.
  env.display(env.HEADER_OK,
              "the contributor capability has been generated " +        \
              "succesfully for '" + name + "'",
              env.OPTION_NONE)
Esempio n. 3
0
def contributor():
    path = None
    link = None
    name = None

    # display.
    env.display(env.HEADER_OK, "generating a contributor's capability",
                env.OPTION_NONE)

    # retrieve the server's code.
    code = ktp.code.Load(env._TEST_STORE_CODE_DIR_ + "/server" +          \
                           ktp.code.Extension)

    # compute the name.
    name = env._USER_

    # compute the file name.
    path = env._TEST_STORE_CAPABILITY_DIR_ + "/" +                        \
      name + ktp.capability.Extension

    # compute the link.
    link = env._TEST_CAPABILITY_

    # create the capability.
    capability = ktp.capability.Create(
        code, name, ktp.capability.TypeContributor, {},
        [{
            "name": env._TEST_NAME_,
            "email": env._TEST_EMAIL_,
            "login": env._TEST_NAME_.lower().replace(" ", ".")
        }])

    # store it.
    ktp.capability.Store(path, capability)

    # remove the previous link.
    env.remove(link, env.OPTION_NONE)

    # create a link from the profile. XXX[this could probably be improved]
    env.link(
        link,
        "../../../../test/store/capability/" + name + ktp.capability.Extension,
        env.OPTION_NONE)

    # display.
    env.display(env.HEADER_OK,
                "the contributor capability has been generated " +        \
                "succesfully for '" + name + "'",
                env.OPTION_NONE)
Esempio n. 4
0
def robot():
    path = None
    link = None
    name = None

    # display.
    env.display(env.HEADER_OK, "generating the robot's capability",
                env.OPTION_NONE)

    # retrieve the server's code.
    code = ktp.code.Load(env._TEST_STORE_CODE_DIR_ + "/server" +          \
                           ktp.code.Extension)

    # compute the name.
    name = "robot"

    # compute the file name.
    path = env._TEST_STORE_CAPABILITY_DIR_ + "/" +                        \
      name + ktp.capability.Extension

    # compute the link.
    link = env._PROFILE_DIR_ + "/user/robot/robot" + ktp.capability.Extension

    # create the capability.
    capability = ktp.capability.Create(
        code, name, ktp.capability.TypeStudent, {}, [{
            "name": "Robot",
            "email": "*****@*****.**",
            "login": "******"
        }])

    # store it.
    ktp.capability.Store(path, capability)

    # remove the previous link.
    env.remove(link, env.OPTION_NONE)

    # create a link from the profile. XXX[this could probably be improved]
    env.link(
        link,
        "../../../../test/store/capability/" + name + ktp.capability.Extension,
        env.OPTION_NONE)

    # display.
    env.display(env.HEADER_OK,
                "the robot's capability has been generated succesfully",
                env.OPTION_NONE)
Esempio n. 5
0
def			machine():
  env.display(env.HEADER_OK,
              "installing links to machine-dependent directories",
              env.OPTION_NONE)

  env.remove(env._GLUE_CURRENT_, env.OPTION_NONE)
  env.link(env._GLUE_CURRENT_, env._GLUE_DIR_, env.OPTION_NONE)

  env.remove(env._PLATFORM_CURRENT_, env.OPTION_NONE)
  env.link(env._PLATFORM_CURRENT_, env._PLATFORM_DIR_, env.OPTION_NONE)

  env.remove(env._ARCHITECTURE_CURRENT_, env.OPTION_NONE)
  env.link(env._ARCHITECTURE_CURRENT_, env._ARCHITECTURE_DIR_, env.OPTION_NONE)
Esempio n. 6
0
def machine():
    env.display(env.HEADER_OK,
                "installing links to machine-dependent directories",
                env.OPTION_NONE)

    env.remove(env._GLUE_CURRENT_, env.OPTION_NONE)
    env.link(env._GLUE_CURRENT_, env._GLUE_DIR_, env.OPTION_NONE)

    env.remove(env._PLATFORM_CURRENT_, env.OPTION_NONE)
    env.link(env._PLATFORM_CURRENT_, env._PLATFORM_DIR_, env.OPTION_NONE)

    env.remove(env._ARCHITECTURE_CURRENT_, env.OPTION_NONE)
    env.link(env._ARCHITECTURE_CURRENT_, env._ARCHITECTURE_DIR_,
             env.OPTION_NONE)
Esempio n. 7
0
def module_action(export_dir, arg):
    env.display(env.HEADER_OK, 'action symlink ' + arg['name'] + ' to ' + arg['target'], env.OPTION_NONE)
    env.link(export_dir + '/' + arg['name'], arg['target'], env.OPTION_NONE)
    return 0