Skip to content

Commit cb9fc3d

Browse files
committed
Rename java_source method to jsource
More consistent with the rest of the library.
1 parent 8846ce5 commit cb9fc3d

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ FUNCTIONS
283283
You can pass a single integer to make a 1-dimensional array of that length.
284284
:return: The newly allocated array
285285

286-
java_source(data)
286+
jsource(data)
287287
Try to find the source code using SciJava's SourceFinder.
288288
:param data:
289289
The object or class or fully qualified class name to check for source code.

src/scyjava/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@
9494
from ._introspect import (
9595
attrs,
9696
fields,
97-
java_source,
9897
jreflect,
98+
jsource,
9999
methods,
100100
src,
101101
)

src/scyjava/_introspect.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def _make_pretty_string(entry, offset):
112112
return f"{return_val} {modifier} = {obj_name}({arg_string})\n"
113113

114114

115-
def java_source(data):
115+
def jsource(data):
116116
"""
117117
Try to find the source code using SciJava's SourceFinder.
118118
:param data:
@@ -166,7 +166,7 @@ def _print_data(data, aspect, static: Optional[bool] = None, source: bool = True
166166
offset = max(list(map(lambda entry: len(entry["returns"]), table)))
167167
all_methods = ""
168168
if source:
169-
urlstring = java_source(data)
169+
urlstring = jsource(data)
170170
print(f"Source code URL: {urlstring}")
171171

172172
# Print methods
@@ -204,5 +204,5 @@ def src(data):
204204
205205
:param data: The Java class, object, or fully qualified class name as string
206206
"""
207-
source_url = java_source(data)
207+
source_url = jsource(data)
208208
print(f"Source code URL: {source_url}")

tests/test_introspect.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def test_find_source(self):
5050
return
5151
str_SF = "org.scijava.search.SourceFinder"
5252
SF = scyjava.jimport(str_SF)
53-
source_strSF = scyjava.java_source(str_SF)
54-
source_SF = scyjava.java_source(SF)
53+
source_strSF = scyjava.jsource(str_SF)
54+
source_SF = scyjava.jsource(SF)
5555
repo_path = "https://github.com/scijava/scijava-search/"
5656
assert source_strSF.startsWith(repo_path)
5757
assert source_SF.startsWith(repo_path)
@@ -65,4 +65,4 @@ def test_imagej_legacy(self):
6565
table = scyjava.jreflect(str_RE, aspect="methods")
6666
assert len([entry for entry in table if entry["static"]]) == 3
6767
repo_path = "https://github.com/imagej/ImageJ/"
68-
assert scyjava.java_source(str_RE).startsWith(repo_path)
68+
assert scyjava.jsource(str_RE).startsWith(repo_path)

0 commit comments

Comments
 (0)