Welcome, Guest
Python Scripts for ComicRack

TOPIC: Debug help needed

Debug help needed 8 years 6 months ago #3695

  • imsabbel3
  • imsabbel3's Avatar
  • Offline
  • Senior Boarder
  • Posts: 78
  • Karma: 0
Hello,

I have a small issue with a script of mine. It fails in a way that i cannot really "get".

Here is the code excerpt:
for book in books:
   bookseries=""
   if book.Series !="": 
      bookseries=book.Series
   else:
      if book.ShadowSeries !="":
         bookseries=book.ShadowSeries
   if book.Number == 1:
      print "1"
      serieslist.append(bookseries)
   else:
      if book.ShadowNumber == 1:
         print "2"
         serieslist.append(bookseries)
      else:
         if book.Number== "":
            if book.ShadowNumber == "":
               if book.Volume == 1:
                  print "3"
                  serieslist.append(bookseries)				

Basically, the code tries to find the first volume / issue of each series, and puts the series with one present into a list.
My problem is that it only works for series that fullfill the last part ("3"). All series that have just a Number one, or a Number and a Volume 1 get completely left out.

I even can have
   print bookseries
   print book.Number
      if book.Number == 1:
         print "1"
and the result will be:
"<name of series>"
"1"
and then nothing, because the if clause doesnt seem to work.

I dont really know python. Am i missing anything here?
Last Edit: 8 years 6 months ago by imsabbel3.
The administrator has disabled public write access.

Re:Debug help needed 8 years 6 months ago #3696

  • imsabbel3
  • imsabbel3's Avatar
  • Offline
  • Senior Boarder
  • Posts: 78
  • Karma: 0
Forgettaboutit...

It seems like the cause was the following
a) Number is a string, but Shadownumber is a number
b) Volume is a number, but Shadowvolume is a string
?!
The administrator has disabled public write access.
Time to create page: 0.174 seconds

Who's Online

We have 231 guests and one member online