Modified Python Script for Easier Functionality
Brought to you by:
poida_smith
Hi there - love the project, great idea. Been looking for something like this for a while. I modified your Python script to add a decorator and a 'built in' function server (rather than the user having to code it per your original example). Usage is as simple as:
import xlloop
# All arguments to expose are optional. Could use '@expose()' instead.
@xlloop.expose(
excel_name='some_other_name',
arg_descrs=['arr is a range of numbers to sum']
)
def test_sum(arr):
'Returns the summation of arr'
return sum(arr[0])
xlloop.run()
Hopefully this makes it a bit easier to get up and running w Python. Also, I think this is the appropriate way to send in a patch - if not, pls let me know how you prefer otherwise. Thanks again!
Hi, thanks for the patch. Not sure how to apply it. Excuse my ignorance. Unified diff format would be good. Cheers.
Sorry about that - I've attached a new file (unified diff format). The last one was just diff'd (no -u flag). If this doesn't work, please advise. Thanks!
src/xlloop.py patch (unified diff format)
Thanks. Much easier this time! Have applied and will release with next version. Cheers. Would like to add your name to the release notes for the next version if you don't mind?
Sure, that'd be fine. Kevin T. Ryan. Thx!
I have a couple of small suggestions for xlloop.py:
add hostname as a property to XLLoopServer defaulting to 'localhost'
test for empty strings in XLCodec.decode before calling ord()
I can email a diff if needed.