Fixes #115.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1377 ed100bfc-0583-0410-97f2-c26b58777a21
Fix for #117 plus regression test.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1378 ed100bfc-0583-0410-97f2-c26b58777a21
Fixes a stray line of code I found where calling header.append() with only a keyword caused two keywords to be inserted.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1380 ed100bfc-0583-0410-97f2-c26b58777a21
This should fix #118.  I'm not sure what 'args' was doing in the legacy_args list.  Also updated the pertinent test to catch this in the future.  This was surprisingly difficult to track down.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1381 ed100bfc-0583-0410-97f2-c26b58777a21
Have Header.cards return a _CardAccessor rather than just a tuple.  This is far more powerful, and I don't know why this wasn't done in the first place.  There was one piece of functionality where the separate 'CardList' class was good: Whereas __getitem__ on a Header returned a value associated with a keyword, __getitem__ on CardList returned the whole Card object associated with a keyword.  This is mostly useful for copying indvidual Cards, in their entirety, from one Header to another.  There are other ways to accomplish this, but this is far more convenient.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1383 ed100bfc-0583-0410-97f2-c26b58777a21
Have the card accessor's repr show the repr for each card, rather than its str value.  This makes it more clear that the card accessor is returning card objects and is not a header object.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1385 ed100bfc-0583-0410-97f2-c26b58777a21
Some fixes to the changelog

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1386 ed100bfc-0583-0410-97f2-c26b58777a21
Implemented setitem on _HeaderCommentaryCards accessors. This addresses an issue that Matt brought up a few days ago where it wasn't easy to update a specific history item.  Now it should be simple.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1388 ed100bfc-0583-0410-97f2-c26b58777a21
Simplified the repr for HeaderCommentaryCards accessors so that the index displayed, taking HISTORY cards for example, is the index of the nth HISTORY card, and not that card's index in the header.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1389 ed100bfc-0583-0410-97f2-c26b58777a21
Brought the changelog for 3.1.0 fully up to date. Fortunately, the vast majority of the changes made since the 3.0 release have been bug fixes that were included in the 3.0.x released.  There aren't too many distinct changes in 3.1 OTHER than the Header API changes (which still need better documenting).

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1391 ed100bfc-0583-0410-97f2-c26b58777a21
This should fix #119 while still maintaining support for the issues raises in #84 and subsequently #101.  There are three cases that are supported here:  1) Opening a scaled file in update mode and the closing it without touching the data.  This should cause no change to the data.  2) Opening a scaled file in update mode, reading the data, then closing the file.  This should cause the file to be updated to with the rescaled data.  3) Opening a scaled file and then calling the writeto() method to write it to a new file.  The new file should contain the rescaled data.  If the original file was opened in 'update' mode, this will also cause the original file to be rescaled--this is because the data had to be accessed to write to a new file, althought it was not directly accessed by the user.  If the original file was opened in 'readonly' mode it should of course be unmodified.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1392 ed100bfc-0583-0410-97f2-c26b58777a21
Fixes #122, and adds a regression test.  This caused the header parsing code to grow a bit in complexity, but by reorganizing things and removing the peeknext() function I was able to simplify things a bit.  The new code involves a little less substring copying than the previous version, so it should also be a little faster, albeit not particularly noticeably.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1393 ed100bfc-0583-0410-97f2-c26b58777a21
Updating the changelog for #119 and preparing it for release.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1394 ed100bfc-0583-0410-97f2-c26b58777a21
Updated to the new URL for the development staging site.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1395 ed100bfc-0583-0410-97f2-c26b58777a21
Slight fix to this test--it should have just been comparing st_mtime, not the whole stat structure (the only way the latter could have been working is if the filesystem is being mounted with no atime support

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1408 ed100bfc-0583-0410-97f2-c26b58777a21
This should fix #124.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1409 ed100bfc-0583-0410-97f2-c26b58777a21
This should fix #125.

First I fixed the regression test for #119 that was incorrect, so that now it shows that merely opening and closing the file does cause its mtime to change (even if it didn't cause the contents to change).

I made a couple fixes to the Header class to improve how it reports whether or not it's been modified.  Now Header._modified is a property which also checks whether or not all the *cards* in that header have been modified directly, in addition to whether the header itself has been modified, either through insertions, deletions, or moves.

The improved modification tracking for Headers actually opened another can of worms in code that was unintentionally relying on the old buggy behavior.  I needed to re-re-re-re-re-re-re-think image scaling.  I finally went ahead and added some internal _orig_bitpix, _orig_bzero, and _orig_bscale attributes that always contain the correct values for rescaling the image.  This solved a lot of problems, and allowed me to clean up some spaghetti code.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1410 ed100bfc-0583-0410-97f2-c26b58777a21
Removed the behavior where Header.keys() did not return duplicate or blank keywords.  Instead it's now equivalent to the list created by iterating over the Header object: It returns all keywords in the order they appear in the header, including duplicates.  This is more consistent with how a dict should work--the previous inconsistency could have caused much confusion.  Use set(header) for a set up unique keywords in a header.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1413 ed100bfc-0583-0410-97f2-c26b58777a21