Skip to content

Commit

Permalink
add Request.copy() method
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasRosenstein committed Aug 17, 2018
1 parent 1975e2b commit 5622bff
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -81,6 +81,10 @@ Alternatively, you can clone the repository and use the local install script.
## Changes

### v2.1.5

* Add `Request.copy()` method

### v2.1.4 (2018-08-13)

* Handle relative package links (actually already in 2.1.3)
Expand Down
2 changes: 1 addition & 1 deletion nodepy/__init__.py
Expand Up @@ -25,7 +25,7 @@
similar to Node.js.
"""

__version__ = '2.1.4'
__version__ = '2.1.5'
__author__ = 'Niklas Rosenstein <rosensteinniklas@gmail.com>'

from . import context, runtime
Expand Down
6 changes: 6 additions & 0 deletions nodepy/base.py
Expand Up @@ -174,6 +174,12 @@ def __init__(self, context, directory, string, additional_search_path=()):
def __repr__(self):
return '<Request "{}" from "{}">'.format(self.string, self.directory)

def copy(self, context=None, directory=None, string=None, additional_search_path=None):
if additional_search_path is None:
additional_search_path = self.additional_search_path
return type(self)(context or self.context, directory or self.directory,
string or self.string, additional_search_path)

@property
def related_paths(self):
if not hasattr(self, '_related_paths'):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -12,7 +12,7 @@ def requirements():

setuptools.setup(
name = 'nodepy-runtime',
version = '2.1.4',
version = '2.1.5',
author = 'Niklas Rosenstein',
author_email = 'rosensteinniklas@gmail.com',
url = 'https://github.com/nodepy/nodepy',
Expand Down

0 comments on commit 5622bff

Please sign in to comment.