Annual report pursuant to Section 13 and 15(d)

Income taxes (Details) - Components of income (loss) before income taxes

v3.7.0.1
Income taxes (Details) - Components of income (loss) before income taxes - USD ($)
$ in Thousands
3 Months Ended 12 Months Ended
Jul. 31, 2017
Apr. 30, 2017
Jan. 31, 2017
Oct. 31, 2016
Jul. 31, 2016
Apr. 30, 2016
Jan. 31, 2016
Oct. 31, 2015
Jul. 31, 2017
Jul. 31, 2016
Jul. 31, 2015
Income taxes (Details) - Components of income (loss) before income taxes [Line Items]                      
Income (loss) before taxes $ 71 $ (39) $ (1,000) $ (1,454) $ 37,068 $ (2,113) $ 7,039 $ 4,521 $ (2,422) $ 46,515 $ (2,292)
Domestic Tax Authority [Member]                      
Income taxes (Details) - Components of income (loss) before income taxes [Line Items]                      
Income (loss) before taxes                 (130) 48,847 (615)
Foreign Tax Authority [Member]                      
Income taxes (Details) - Components of income (loss) before income taxes [Line Items]                      
Income (loss) before taxes                 $ (2,292) $ (2,332) $ (1,677)