-
Notifications
You must be signed in to change notification settings - Fork 0
Implement linescan.rescan() #8
Conversation
The Travis CI build results will mostly decide how I continue on.
hopefully fix FileNotFoundError this time
Still have to write documentation and provide examples
Hey, @tribex, if you are not too busy, would you take a look at this? It looks and acts correctly to me (and I have tested many use cases), but it never hurts to have a second opinion. If you can't, that's fine too. Just unsubscribe from the notifications. 😉 |
Sure! starts typing I'm not entirely sure what the correct behavior should be, but it seems to be working so far... My Python skills have gotten a bit rusty... (Currently working with HTML5 on Andriod) :L What do you mean by this?
testfile.txt is almost creepy... EDIT: More complete review, As far as I can tell, it works fine. However, it is a bit confusing to tell what is actually going on behind-the-scenes. There can only be one linescan per script correct? Is there a way you could convert it to an instance-able class? Or is that intentional? I honestly don't see why this is easier to use than the normal way, but I may just be missing something. |
[ci skip]
@tribex Try this: import linescan
one = linescan.scan("examples/testfile.txt", 1)
two = linescan.scan("examples/testfile.txt", 1, 3)
end = linescan.scan("examples/testfile.txt", 1, "end")
print(one)
print(two)
print(end)
one = linescan.scan("examples/testfile.txt", 12)
print(one)
print(two) This shows there can be more than one instance. Before the current revision (there were two other implementations before the current one), performing multiple scans overwrote the last one.
I gave some details as to why I wrote this in http://wp.me/p1V5ge-1nO (or can you not access my blog?). |
@tribex BTW, here is the documentation on
I just realized I might want to add optional
Typo. If you did not want to look at it, click the "Unsubscribe" near the top right of the issue to stop receiving notifications for this pull request. |
Ah, I see now, although it seems like an odd way to instance things. Why the ten line/scan limit? And yes, I can't access your blog. 😦 |
Copy of blog post with rough formatting: https://gist.github.com/le717/b43b023f9a6234016682 linecache also uses a dictionary for instancing, and recall this is inspired by linecache (I wish I could think this is an improved version of linecache save the imported modules searching part :P). It was an arbitrary number I "deducted". It can be changing using |
Ah, thanks, that makes a bit more sense. Looking good. :D |
Thanks for looking it over. :) Last questions: 1. Should I raise the limit from 10 to say, 20? 2. Should I consider adding optional lineno and endline parameters for finer control? I'll go ahead and merge this and make any other changes after you reply. Thanks again. :) |
No problem! Glad to be of service! Maybe you should add an optional parameter for the limit or something. I personally think that more parameters are better, but it might go against the idea of being simple and easy-to-use, your call. 😀 |
I did that in the initial version. See Again, thanks for the review. 😄 |
It took some work, but I have finally implemented
linescan.rescan()
from #2.