Skip to content

Commit

Permalink
fixing merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jdiegodcp committed Feb 22, 2024
2 parents 07dc60d + 9f73b50 commit 8cb637f
Show file tree
Hide file tree
Showing 10 changed files with 1,925 additions and 6 deletions.
2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ contributors:
- `Hynek Schlawack <https://github.com/hynek>`_
- `Matt Montag <https://github.com/mmontag>`_
- `Pierre Tardy <https://github.com/tardyp>`_
- `Pi Delport <https://github.com/PiDelport>`_
- `Pi Delport <https://github.com/PiDelport>`_
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2014-2022 Spotify AB - Discontinued April 2022 and transferred to new maintainer JUAN DIEGO DE LA CRUZ PECHO

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
14 changes: 10 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
ramlfications: RAML reference implementation in Python
======================================================

.. image:: https://img.shields.io/travis/spotify/ramlfications.svg?style=flat-square
:target: https://travis-ci.org/spotify/ramlfications
:alt: CI status

.. image:: https://img.shields.io/pypi/v/ramlfications.svg?style=flat-square
:target: https://pypi.python.org/pypi/ramlfications/
:alt: Latest Version
Expand All @@ -28,6 +24,9 @@ ramlfications: RAML reference implementation in Python

.. begin
Note: this project has been discontinued at Spotify and will be transferred to a new maintainer, we are currently finishing the transfer of this repository and the associated pypi package.


Requirements and Installation
=============================

Expand Down Expand Up @@ -106,6 +105,13 @@ or::
Then within ``ramlfications/docs/_build`` you can open the index.html page in your browser.


Project History
^^^^^^^^^^^^^^^

Ramlfications was originally created by Spotify engineer github.com/econchick, but is currently not in use at Spotify. The project was discontinued
in April 2022 and transferred to an external maintainer.


Still have issues?
^^^^^^^^^^^^^^^^^^

Expand Down
1 change: 1 addition & 0 deletions ramlfications/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from ramlfications.config import setup_config
from ramlfications.parser import parse_raml

from ramlfications.utils import load_file, load_string


Expand Down
44 changes: 44 additions & 0 deletions ramlfications/_helpers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Spotify AB

import os
import sys

import six

from .errors import LoadRAMLError
from .loader import RAMLLoader

if sys.version_info[0] == 2:
from io import open


def load_file(raml_file):
try:
with _get_raml_object(raml_file) as raml:
return RAMLLoader().load(raml)
except IOError as e:
raise LoadRAMLError(e)


def load_string(raml_str):
return RAMLLoader().load(raml_str)


def _get_raml_object(raml_file):
"""
Returns a file object.
"""
if raml_file is None:
msg = "RAML file can not be 'None'."
raise LoadRAMLError(msg)

if isinstance(raml_file, six.text_type) or isinstance(
raml_file, bytes):
return open(os.path.abspath(raml_file), 'r', encoding="UTF-8")
elif hasattr(raml_file, 'read'):
return raml_file
else:
msg = ("Can not load object '{0}': Not a basestring type or "
"file object".format(raml_file))
raise LoadRAMLError(msg)
10 changes: 10 additions & 0 deletions ramlfications/loader.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Spotify AB

<<<<<<< HEAD
from __future__ import absolute_import, division, print_function
=======
try:
from collections import OrderedDict
except ImportError: # pragma: no cover
from ordereddict import OrderedDict
>>>>>>> master

import os
import jsonref
Expand All @@ -21,6 +28,9 @@
RAML10_FRAGMENT_TYPES = ("DataType", "AnnotationType")


__all__ = ["RAMLLoader"]


class RAMLLoader(object):
"""
Extends YAML loader to load RAML files with ``!include`` tags.
Expand Down
Loading

0 comments on commit 8cb637f

Please sign in to comment.