KermMartian wrote:
This sounds great, thanks for letting us know! I've caught quite a few GUI hints in there; is this something that you're planning? Or are you hoping someone else will decide to make the GUI for it?


Yes, ScoutDavid is making a GUI for it using wxPython.

I'd consider making one except I know almost nothing about GUI programming with Python, or which toolkit would be best to use for doing such a thing.
TC01 wrote:
KermMartian wrote:
This sounds great, thanks for letting us know! I've caught quite a few GUI hints in there; is this something that you're planning? Or are you hoping someone else will decide to make the GUI for it?


Yes, ScoutDavid is making a GUI for it using wxPython.

I'd consider making one except I know almost nothing about GUI programming with Python, or which toolkit would be best to use for doing such a thing.
Oh, ScoutDavid knows wxPython? Then good luck, I shall look forward to seeing what he creates.
I've released version 0.7 (To the Cemetech archives, and it will be sitting on ticalc.org's pending file list in a bit). Download link is: here.

I might as well just post the changelog from the readme:

-Added an option to search the file index rather than the name index (-f)
-Added logging functionality (-l) that logs output to a textfile, calcpkg.log
-Added clean command, which removes all .zip, .tar.gz, and .log files from the current folder
-Added mechanism for easily redirecting output (allowing another program to make all the print statements go somewhere else)
-Added a fake "search" command that does the same thing as "list"
-Added options for disabling the prompts before downloading and updating (-n and -p respectively)
-Included a sample script that shows how calcpkg can be imported in a module and used as part of another program
-Fixed bug where -g and -m searching options ran together would not work
-The searching options now work with the count and get commands as well
Great job, TC01! Is this the first one that properly handles the same index file for the Windows and Linux version, or did I miss that in your previous changelogs? How are ScoutDavid's attempts at a GUI going?
KermMartian wrote:
Great job, TC01! Is this the first one that properly handles the same index file for the Windows and Linux version, or did I miss that in your previous changelogs? How are ScoutDavid's attempts at a GUI going?


Yeah, it's the first one.

ScouDavid was having trouble implementing options, because in the previous version, I was just passing an optparse object to each function that needed it rather than individual boolean and string variables. I've fixed that now (and included the sample script), so he should have an easier time of it.
TC01 wrote:
KermMartian wrote:
Great job, TC01! Is this the first one that properly handles the same index file for the Windows and Linux version, or did I miss that in your previous changelogs? How are ScoutDavid's attempts at a GUI going?


Yeah, it's the first one.

ScouDavid was having trouble implementing options, because in the previous version, I was just passing an optparse object to each function that needed it rather than individual boolean and string variables. I've fixed that now (and included the sample script), so he should have an easier time of it.


I haven't even checked the .py file, but from what he said I think it'll be easier now Smile Probably, the only difficult part will be the GUI Design :s
I would imagine that all of the callback functions will be quite challenging too, but I'll look forward to seeing what you make. I also would be more than happy to critique any GUI prototypes that you come up with.
So... I know I haven't worked on any of my projects for ages: you can thank a certain game called Minecraft for that. Razz

On Omni, Netham suggested using the RSS to update the indexes, something I've been thinking about. What I could do is add a "check" command which will read the RSS feed on the site. If the last file on the RSS feed is known (is found in the index), it will then go through the RSS, find all new files and add them to the local database.

The downside of doing this? I'd need to add a dependency- the feedparser module. It's a third-party Python library for RSS manipulation, and I'd need it to look at the entries in the feed. And I know dependencies can be annoying...

As for other things to add, one idea could be something with automatic extraction. Perhaps an opt to unzip all archive files it downloads? Or maybe even a search op to let you specify the file extension (search only for .zip and not, say, .tar.gz for Linux software, or only for Linux software).

The only reason I use ticalc.org rather than this sometimes is when I want to look at reviews- something this program doesn't show you. I'd want to add an "info" command to post a link to the file info page... unfortunately I'm not sure what the best way to get the file info page would be- the index file only has the direct link to the file. Any ideas?
I'm pretty sure that there are some built-in XML-parsing modules that could quickly and easily parse an RSS feed without needing feedparser, which I'm sure is way overkill for you. I'm interested in building a file transfer / FTP-type CALCnet2.2 app, and if I do, I may implement some extended form of your software to enable calculators to directly browse ticalc.org and download software.
KermMartian wrote:
I'm pretty sure that there are some built-in XML-parsing modules that could quickly and easily parse an RSS feed without needing feedparser, which I'm sure is way overkill for you. I'm interested in building a file transfer / FTP-type CALCnet2.2 app, and if I do, I may implement some extended form of your software to enable calculators to directly browse ticalc.org and download software.


Well, there are built-in XML modules, and they probably could do it: but feedparser is an easier way to do it.

What I'm probably going to do though is make it an optional dependency (so that the check command simply doesn't work if you don't have it installed).

I suspected you'd be interested in making a file transfer app for gCn... would it have the files be downloaded to the computer where the client is running and unpacked there, and then send any .8x* files to the calc? Or would the unpacking occur on the actual calculator?
Well, I'm imagining something running entirely on my server, so that there's just one centralized source for files. It would present an FTP-like hierarchy of files to the user, and when the user chose to fetch a particular .zip, it would be responsible for opening the zip, extracting the *.8x* files, and passing each such file to the client over gCn.
TC01 wrote:
On Omni, Netham suggested using the RSS to update the indexes, something I've been thinking about. What I could do is add a "check" command which will read the RSS feed on the site. If the last file on the RSS feed is known (is found in the index), it will then go through the RSS, find all new files and add them to the local database.


That's a cool idea, but that RSS feed (and several others) have apparently been broken for a while. Sad Not sure when it happened or what's wrong at this point, though. The data appears to be at least partially there, but there are apparently some major syntax errors because my browser doesn't seem to parse it at all.

Quote:
The only reason I use ticalc.org rather than this sometimes is when I want to look at reviews- something this program doesn't show you. I'd want to add an "info" command to post a link to the file info page... unfortunately I'm not sure what the best way to get the file info page would be- the index file only has the direct link to the file. Any ideas?


I don't know of a way to directly translate a file path to an ID on the user side of things, unfortunately. Maybe you could take the file URL, strip off the filename at the end, which will give the URL for the directory page, and then try to parse that page to find the filename and its fileinfo page link. Though that's a messy solution, and it could break if the HTML code we use ever changed.
Some good points, Travis. I remember back in the day there was a ticalc.org application of some sort that would pull your author profile and all your programs and stats, and display them in a set of nice codified, tablified views, but if I recall correctly (unless my memory is being unnecessarily mean) the ticalc.org staff weren't happy at all. Has the policy changed now that you guys are on a faster server?
If you mean TIreport, I didn't know anyone was upset. One of the staff members, Morgan, even wrote a positive review for it. Unfortunately, it no longer works because it uses regular expressions to parse the HTML (never a good idea Wink); at some point (probably after the server move) something changed and some line breaks/whitespace in the fileinfo page HTML got moved around, breaking that script.

What would be really cool is if we had some sort of service or something on the server that could provide easily-parseable yet low-bandwidth file/stats information intended specifically for programs like TIreport, ticalc.org StatChecker, “ticalc.org ‘Package Manager’”, etc.
I'm against all of this.

Although an API would be cool.
allynfolksjr wrote:
I'm against all of this.

Although an API would be cool.
So you're not really against all of this then, are you? Laughing I agree that an API into ticalc.org would be great. ticalc.org on your iDevice? There's an app for that! On Android? You know it! gCn? Yup, and without awkward HTML parsing.
Travis wrote:
What would be really cool is if we had some sort of service or something on the server that could provide easily-parseable yet low-bandwidth file/stats information intended specifically for programs like TIreport, ticalc.org StatChecker, “ticalc.org ‘Package Manager’”, etc.


Does StatChecker still work? I can't remember the last time I checked it, but I probably didn't even have the sense to use regex at the time.
I remember toying around with StatChecker once a while back (after discovering that TIreport no longer worked) and managed to get it working again with a couple of minor changes. It was not finding the fileinfo page URLs for each file because the find function looking for the end of the URL was searching from the beginning of the line (which now contains more HTML tags since the server move) rather than from the beginning of the HREF tag it wanted, and an unrelated tag was screwing it up. It also wasn't handling cases where there are less than three lines of stats on a fileinfo page (which can happen sometimes, like if there are no downloads for the past week, in which case that line does not show up) very well.

I forgot all about it and almost lost my modified version when doing some “spring cleaning” (just now had to dig it out of an old backup archive that I luckily didn't get around to deleting just yet Razz).


Code:

--- statchecker.py   2006-03-27 01:46:50.000000000 -0600
+++ statchecker.new.py   2010-08-02 12:27:38.000000000 -0600
@@ -1,4 +1,4 @@
-#! /usr/local/bin/python
+#! /usr/bin/env python
 import sys
 import os
 import urllib
@@ -20,7 +20,8 @@
          if -1!=statstart:
             print "\t" + x[statstart:x.find("<A")] + "list" + x[x.find("</A>") + 4:x.find("<BR>")]
             statstart = x.find("<BR>") + 4
-            print "\t" + x[statstart:x.find("<A",statstart)] + "list" + x[x.find("</A>",statstart) + 4:x.find("<BR>",statstart)]
+            if -1!=x.find("<A",statstart):
+               print "\t" + x[statstart:x.find("<A",statstart)] + "list" + x[x.find("</A>",statstart) + 4:x.find("<BR>",statstart)]
          if -1!=x.find("This file is new") or -1!=x.find("This file is in a directory that is not included in ranking."):
             print x
 
@@ -59,7 +60,7 @@
                print "Ranked number " + x[rankstart + 18:x.find(" ",rankstart+18)] + " in our list of most downloaded authors for the past seven days with " + x[x.find("days with ")+10:x.find("<BR>",rankstart + 4)]
             filestart = x.find("HREF=\"/archives/files/fileinfo")
             if -1!=filestart:
-               self.checkFile("http://www.ticalc.org" + x[filestart + 6:x.find("\">")])
+               self.checkFile("http://www.ticalc.org" + x[filestart + 6:x.find("\">",filestart)])
          return None
       
 checker = StatChecker()
Thanks for sharing that code, Travis; I'll try to give that program a try. I remember back in the early days, when I was leaping author download ranks at the rate of a handful a day, I would travel to the library as often as I could to print out the first page of my author profile and draw out rank and download count graphs on graph paper. Smile This certainly would be a less time-consuming way to do the same.
Well, since the RSS is broken, I might as well release 0.8 now. Here's the full changelog:

-Added a fake "install" command that does the same thing as "get"
-Added an option to search by file extensions (like .zip or .tar.gz)
-Added an option to extract all .zip archives on download, named like:
"83plus-asm-games-generate-zip"
-Added an option to only print the version and then exit
-Clean command will now remove files created by the extraction option
-Fixed a bug when using the get command with search options where it downloaded as if the opts weren't specified

Direct download available from here until it gets through the Cemetech and ticalc.org download queues.


I would definitely support an API for ticalc.org, as it would make writing programs like this a lot easier.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 3 of 4
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement