New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Python error in PDF generator and Open in Composer using IFCW #2532

Closed
vasanthi0808 opened this Issue Dec 22, 2015 · 8 comments

Comments

Projects
None yet
5 participants
@vasanthi0808

vasanthi0808 commented Dec 22, 2015

Problem

Python error when trying to generate the PDF report.

Detail

I tried to run the Jakarta flood scenario using vector data for hazard and population raster data for the exposure. Python errorr appeared when trying to generate the report.
This problem also happens with other scenarios using IFCW.
This message appear:

An error has occured while executing Python code:


Traceback (most recent call last):
  File "C:/Users/Vasanthi/.qgis2/python/plugins\inasafe\safe\gui\tools\wizard_dialog.py", line 3768, in on_pbnReportPDF_released
    self.analysis_handler.print_map('pdf')
  File "C:/Users/Vasanthi/.qgis2/python/plugins\inasafe\safe\utilities\analysis_handler.py", line 539, in print_map
    print_dialog.buttonBox.addButton(
AttributeError: 'ImpactReportDialog' object has no attribute 'buttonBox'


Python version:
2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]


QGIS version:
2.8.4-Wien Wien, 71ba2c7

Python path: ['C:/Users/Vasanthi/.qgis2/python/plugins\\processing', 'C:/PROGRA~1/QGISWI~1/apps/qgis-ltr/./python', u'C:/Users/Vasanthi/.qgis2/python', u'C:/Users/Vasanthi/.qgis2/python/plugins', 'C:/PROGRA~1/QGISWI~1/apps/qgis-ltr/./python/plugins', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages\\matplotlib-1.3.1-py2.7-win-amd64.egg', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages\\nose-1.3.3-py2.7.egg', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages\\tornado-4.0.1-py2.7-win-amd64.egg', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages\\backports.ssl_match_hostname-3.4.0.2-py2.7.egg', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages\\certifi-14.05.14-py2.7.egg', 'C:\\PROGRA~1\\QGISWI~1\\bin\\python27.zip', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\DLLs', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\plat-win', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\lib-tk', 'C:\\PROGRA~1\\QGISWI~1\\bin', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages\\PIL', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages\\jinja2-2.7.2-py2.7.egg', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages\\markupsafe-0.23-py2.7-win-amd64.egg', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages\\pytz-2012j-py2.7.egg', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages\\win32', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages\\win32\\lib', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages\\Pythonwin', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages\\Shapely-1.2.18-py2.7-win-amd64.egg', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages\\six-1.3.0-py2.7.egg', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages\\wx-2.8-msw-unicode', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages\\xlrd-0.9.2-py2.7.egg', 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\lib\\site-packages\\xlwt-0.7.5-py2.7.egg', u'C:/Users/Vasanthi/.qgis2//python', 'C:/Users/Vasanthi/.qgis2/python/plugins\\inasafe', 'C:\\Users\\Vasanthi\\.qgis2\\python\\plugins\\inasafe\\safe_extras\\parameters', 'C:\\Users\\Vasanthi\\.qgis2\\python\\plugins', 'C:\\Users\\Vasanthi\\.qgis2\\python\\plugins\\inasafe\\safe_extras', 'C:\\PROGRA~1\\QGISWI~1\\apps\\qgis-ltr\\python\\plugins\\fTools\\tools', 'D:/WORK!/InaSAFE Freeze Desember/InaSAFE ScenarioData/Flood/Jakarta']

Screenshot

ifcw pdf

Specification

Windows 7 64 Bit
RAM 4GB
QGIS 2.8.4 Wien
InaSAFE 3.2.5 dev-master

Cc : @timlinux @ismailsunni

@vasanthi0808 vasanthi0808 changed the title from [BUG] Could not generate PDF report in IFCW to [BUG] Python error in PDF generator and Open in Composer using IFCW Dec 22, 2015

@ismailsunni ismailsunni self-assigned this Dec 22, 2015

@ismailsunni ismailsunni added the Bug label Dec 22, 2015

Gustry added a commit to Gustry/inasafe that referenced this issue Dec 22, 2015

@Gustry

This comment has been minimized.

Show comment
Hide comment
@Gustry

Gustry Dec 22, 2015

Contributor

Oups, sorry @ismailsunni I saw your assignment after.
There isn't unit test for analysis_handler.py. Maybe we should write some ?

Contributor

Gustry commented Dec 22, 2015

Oups, sorry @ismailsunni I saw your assignment after.
There isn't unit test for analysis_handler.py. Maybe we should write some ?

@ismailsunni ismailsunni assigned Gustry and unassigned ismailsunni Dec 22, 2015

@ismailsunni

This comment has been minimized.

Show comment
Hide comment
@ismailsunni

ismailsunni Dec 22, 2015

Member

@Gustry
no problem, I can assign it to you happily 💃

There isn't unit test for analysis_handler.py. Maybe we should write some ?

Yeah, we should do that for sure

Thanks :D

Member

ismailsunni commented Dec 22, 2015

@Gustry
no problem, I can assign it to you happily 💃

There isn't unit test for analysis_handler.py. Maybe we should write some ?

Yeah, we should do that for sure

Thanks :D

ismailsunni added a commit that referenced this issue Dec 23, 2015

Merge pull request #2534 from Gustry/fix-2532
fix var name #2532

I will merge this since I need to merge it to master

ismailsunni added a commit to ismailsunni/inasafe that referenced this issue Dec 23, 2015

@ismailsunni

This comment has been minimized.

Show comment
Hide comment
@ismailsunni

ismailsunni Dec 23, 2015

Member

Fixed in #2534

Member

ismailsunni commented Dec 23, 2015

Fixed in #2534

@harrymahar

This comment has been minimized.

Show comment
Hide comment
@harrymahar

harrymahar Dec 23, 2015

@ismailsunni I have update my InaSAFE recently using git bash and run flood scenario using IFCW again. However, the result still has python error when I want to generate pdf or open map composer.

harrymahar commented Dec 23, 2015

@ismailsunni I have update my InaSAFE recently using git bash and run flood scenario using IFCW again. However, the result still has python error when I want to generate pdf or open map composer.

@ismailsunni ismailsunni reopened this Dec 23, 2015

@ismailsunni

This comment has been minimized.

Show comment
Hide comment
@ismailsunni

ismailsunni Dec 23, 2015

Member

@harrymahar
Can you paste here the python error?
And can you paste here your inasafe hash value? *do git log and copy the first hash value

Member

ismailsunni commented Dec 23, 2015

@harrymahar
Can you paste here the python error?
And can you paste here your inasafe hash value? *do git log and copy the first hash value

@harrymahar

This comment has been minimized.

Show comment
Hide comment
@harrymahar

harrymahar Dec 23, 2015

Hai @ismailsunni
Python Error :
python error_flood_ifcw

git log :
python error_flood_ifcw_2

harrymahar commented Dec 23, 2015

Hai @ismailsunni
Python Error :
python error_flood_ifcw

git log :
python error_flood_ifcw_2

@ismailsunni

This comment has been minimized.

Show comment
Hide comment
@ismailsunni

ismailsunni Dec 23, 2015

Member

hi @harrymahar
Please try again, I just push my fix to develop.

Member

ismailsunni commented Dec 23, 2015

hi @harrymahar
Please try again, I just push my fix to develop.

@harrymahar

This comment has been minimized.

Show comment
Hide comment
@harrymahar

harrymahar Dec 23, 2015

Hi @ismailsunni
Yaay, it is work now.. Thanks
print composer

generate pdf

harrymahar commented Dec 23, 2015

Hi @ismailsunni
Yaay, it is work now.. Thanks
print composer

generate pdf

ismailsunni added a commit to ismailsunni/inasafe that referenced this issue Dec 23, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment