I am making several maps from a template with a PyQGIS script and I am having problems to align the scale bar on them. My code is:
# create scale bar
item = QgsComposerScaleBar(comp)
item.setStyle('Single Box') # Other possibilities are: 'Single Box', 'Double Box', 'Line Ticks Middle', 'Line Ticks Down', 'Line Ticks Up', 'Numeric'
item.setComposerMap(composerMap)
item.applyDefaultSize()
item.setAlignment('Right')
comp.addItem(item)
I've found the QgsComposerScaleBar.setAlignment()
QGIS API Documentation, but when I introduce 'Right' as a parameter I get a type error message. I am using QGIS 2.6.0