Example #1
0
 def charp2strn(cp, maxlen):
     b = builder_class(maxlen)
     i = 0
     while i < maxlen and cp[i] != lastchar:
         b.append(cp[i])
         i += 1
     return assert_str0(b.build())
Example #2
0
 def charp2strn(cp, maxlen):
     b = builder_class(maxlen)
     i = 0
     while i < maxlen and cp[i] != lastchar:
         b.append(cp[i])
         i += 1
     return assert_str0(b.build())
Example #3
0
 def charp2str(cp):
     b = builder_class()
     i = 0
     while cp[i] != lastchar:
         b.append(cp[i])
         i += 1
     return assert_str0(b.build())
Example #4
0
 def charp2str(cp):
     b = builder_class()
     i = 0
     while cp[i] != lastchar:
         b.append(cp[i])
         i += 1
     return assert_str0(b.build())
Example #5
0
    def load_feature(space, path, orig_path):
        if not os.path.exists(assert_str0(path)):
            raise space.error(space.w_LoadError, orig_path)

        f = open_file_as_stream(path)
        try:
            contents = f.readall()
        finally:
            f.close()

        space.execute(contents, filepath=path)
Example #6
0
    def load_feature(space, path, orig_path):
        if not os.path.exists(assert_str0(path)):
            raise space.error(space.w_LoadError, orig_path)

        f = open_file_as_stream(path)
        try:
            contents = f.readall()
        finally:
            f.close()

        space.execute(contents, filepath=path)
Example #7
0
    def find_feature(space, path):
        if not path.endswith(".rb"):
            path += ".rb"

        if not (path.startswith("/") or path.startswith("./") or path.startswith("../")):
            w_load_path = space.globals.get("$LOAD_PATH")
            for w_base in space.listview(w_load_path):
                base = space.str_w(w_base)
                full = os.path.join(base, path)
                if os.path.exists(assert_str0(full)):
                    path = os.path.join(base, path)
                    break
        return path
Example #8
0
    def find_feature(space, path):
        if not path.endswith(".rb"):
            path += ".rb"

        if not (path.startswith("/") or path.startswith("./")
                or path.startswith("../")):
            w_load_path = space.globals.get("$LOAD_PATH")
            for w_base in space.listview(w_load_path):
                base = space.str_w(w_base)
                full = os.path.join(base, path)
                if os.path.exists(assert_str0(full)):
                    path = os.path.join(base, path)
                    break
        return path