Problem migrating images using CoPress-Convert.py

2 views
Skip to first unread message

Drew University Acorn

unread,
Mar 27, 2011, 5:27:12 PM3/27/11
to CoPress
As a student moving from CP5 to wordpress, I found your conversion
script, CoPress-Convert.py, to be very helpful. College Media Network
sent my database as a .txt file which I converted into CVS. After
labeling my columns based on the names in the Python script (which I
read), I was able to get everything going except for pictures. By
removing the code for the "images" column, I could get the articles
converted, but obviously not the pictures along with them. So far, I
can get my articles on the my new website. With the code intact, I get
the following error from line 748:

TypeError: 'int' object is not iterable.

Do you know how I could solve this issue? Your help would be greatly
appreciated.

(If it helps, here's what a typical cell in the "images" column looks
like)

1.840688:3829103849.JPG:DSC01996.JPG:Dan Sorenson ('09) passes the
ball to Sarah 'Ramrod' Davie ('10), as the team marvels at his
skills.:John Bone

Daniel Bachhuber

unread,
Mar 27, 2011, 8:15:50 PM3/27/11
to cop...@googlegroups.com
Hey Steven,
Can you put a few entire rows into Pastebin and send the link along? http://pastebin.com/ I suspect it's not picking up the images column correctly. Thus, when it tries to iterate through the attached images, it breaks.

Thanks,

Daniel

> --
> You received this message because you are a part of CoPress (http://www.copress.org/).
> - To post a message to this group, send email to cop...@googlegroups.com
> - To unsubscribe from this group, send an email to copress+u...@googlegroups.com
> - For more options, visit this group at http://groups.google.com/group/copress
> - Get connected on Twitter http://www.twitter.com/copress or Facebook http://www.facebook.com/copress
>
> http://www.copress.org/

--
http://db.ly/info

Drew University Acorn

unread,
Mar 27, 2011, 8:57:29 PM3/27/11
to CoPress
Here's the link

http://pastebin.com/fcvjzqVv

Normally, the image column is titled "images", not "image" as it is in
there.

On Mar 27, 8:15 pm, Daniel Bachhuber <d...@danielbachhuber.com> wrote:
> Hey Steven,
> Can you put a few entire rows into Pastebin and send the link along?http://pastebin.com/I suspect it's not picking up the images column correctly. Thus, when it tries to iterate through the attached images, it breaks.
>
> Thanks,
>
> Daniel
>
> On 27 Mar 2011, at 5:27 PM, Drew University Acorn wrote:
>
>
>
> > As a student moving from CP5 to wordpress, I found your conversion
> > script, CoPress-Convert.py, to be very helpful. College Media Network
> > sent my database as a .txt file which I converted into CVS. After
> > labeling my columns based on the names in the Python script (which I
> > read), I was able to get everything going except for pictures. By
> > removing the code for the "images" column, I could get the articles
> > converted, but obviously not the pictures along with them. So far, I
> > can get my articles on the my new website. With the code intact, I get
> > the following error from line 748:
>
> > TypeError: 'int' object is not iterable.
>
> > Do you know how I could solve this issue? Your help would be greatly
> > appreciated.
>
> > (If it helps, here's what a typical cell in the "images" column looks
> > like)
>
> > 1.840688:3829103849.JPG:DSC01996.JPG:Dan Sorenson ('09) passes the
> > ball to Sarah 'Ramrod' Davie ('10), as the team marvels at his
> > skills.:John Bone
>
> > --
> > You received this message because you are a part of CoPress (http://www.copress.org/).
> > - To post a message to this group, send email to cop...@googlegroups.com
> > - To unsubscribe from this group, send an email to copress+u...@googlegroups.com
> > - For more options, visit this group athttp://groups.google.com/group/copress

Daniel Bachhuber

unread,
Mar 27, 2011, 11:12:50 PM3/27/11
to cop...@googlegroups.com
Is this data stored in a separate file now?

Drew University Acorn

unread,
Mar 27, 2011, 11:34:04 PM3/27/11
to CoPress
No, I just copy and pasted the "images" cell column from my
stories.csv file. When you said entire rows, though, did you mean just
for that column, or all the cells in a row, including ones not part of
the images column. If that's the case, I can e-mail you a csv file of
some rows--if I paste them in Pastebin, they don't retain proper
spacing to signify columns, so I can only imagine it would be
confusing to read.

On Mar 27, 11:12 pm, Daniel Bachhuber <d...@danielbachhuber.com>
wrote:
> Is this data stored in a separate file now?
>
> On 27 Mar 2011, at 8:57 PM, Drew University Acorn wrote:
>
>
>
> > Here's the link
>
> >http://pastebin.com/fcvjzqVv
>
> > Normally, the image column is titled "images", not "image" as it is in
> > there.
>
> > On Mar 27, 8:15 pm, Daniel Bachhuber <d...@danielbachhuber.com> wrote:
> >> Hey Steven,
> >> Can you put a few entire rows into Pastebin and send the link along?http://pastebin.com/Isuspect it's not picking up the images column correctly. Thus, when it tries to iterate through the attached images, it breaks.
> >>> - Get connected on Twitterhttp://www.twitter.com/copressorFacebookhttp://www.facebook.com/copress

Daniel Bachhuber

unread,
Mar 27, 2011, 11:57:39 PM3/27/11
to cop...@googlegroups.com
If you could email a dozen or two rows in CSV format, that'd be great. I'll try running it against the script sometime hopefully tomorrow

Cheers,

Daniel

Daniel Bachhuber

unread,
Mar 28, 2011, 7:51:28 PM3/28/11
to CoPress
Hey Steven,
I think I've figured it out. The issue is that the script expects
multiple images when there's just one. Here's my fix:

https://github.com/danielbachhuber/CoPress-Convert/commit/804c08d5a109c0ac0746c404126c2f83117265f6

Download the latest copy of that development version and let me know
if it works for you (it runs fine now for me)

Cheers,

Daniel

On Mar 27, 11:57 pm, Daniel Bachhuber <d...@danielbachhuber.com>
wrote:
> If you could email a dozen or two rows in CSV format, that'd be great. I'll try running it against the script sometime hopefully tomorrow
>
> Cheers,
>
> Daniel
>
> On 27 Mar 2011, at 11:34 PM, Drew University Acorn wrote:
>
>
>
>
>
>
>
>
>
> > No, I just copy and pasted the "images" cell column from my
> > stories.csv file. When you said entire rows, though, did you mean just
> > for that column, or all the cells in a row, including ones not part of
> > the images column. If that's the case, I can e-mail you a csv file of
> > some rows--if I paste them in Pastebin, they don't retain proper
> > spacing to signify columns, so I can only imagine it would be
> > confusing to read.
>
> > On Mar 27, 11:12 pm, Daniel Bachhuber <d...@danielbachhuber.com>
> > wrote:
> >> Is this data stored in a separate file now?
>
> >> On 27 Mar 2011, at 8:57 PM, Drew University Acorn wrote:
>
> >>> Here's the link
>
> >>>http://pastebin.com/fcvjzqVv
>
> >>> Normally, the image column is titled "images", not "image" as it is in
> >>> there.
>
> >>> On Mar 27, 8:15 pm, Daniel Bachhuber <d...@danielbachhuber.com> wrote:
> >>>> Hey Steven,
> >>>> Can you put a few entire rows into Pastebin and send the link along?http://pastebin.com/Isuspectit's not picking up the images column correctly. Thus, when it tries to iterate through the attached images, it breaks.

Drew University Acorn

unread,
Mar 29, 2011, 1:07:17 PM3/29/11
to CoPress
Success! Thanks, Dan, this works perfectly. Although the images seem
to be placed in each post at native resolution, I'm going to have my
current assistant make fix this through a batch jpg change in Adobe
bridge.

Thanks, Dan!

On Mar 28, 7:51 pm, Daniel Bachhuber <d...@danielbachhuber.com> wrote:
> Hey Steven,
> I think I've figured it out. The issue is that the script expects
> multiple images when there's just one. Here's my fix:
>
> https://github.com/danielbachhuber/CoPress-Convert/commit/804c08d5a10...
> > >>>> Can you put a few entire rows into Pastebin and send the link along?http://pastebin.com/Isuspectit'snot picking up the images column correctly. Thus, when it tries to iterate through the attached images, it breaks.

Daniel Bachhuber

unread,
Mar 29, 2011, 1:25:04 PM3/29/11
to cop...@googlegroups.com
Glad to hear!

Miles Skorpen

unread,
Mar 29, 2011, 1:55:53 PM3/29/11
to copress, Daniel Bachhuber
Drew--

Check the CSS. I believe the script gives images an ID or places them in a div, and you can scale them that way, rather than actually changing the file sizes.

Miles
Reply all
Reply to author
Forward
0 new messages