THE first job in the in-tray of the SNP’s expanded team at the European Parliament is the task which matters above all else: stopping Brexit.

Of course, had Scotland voted for independence in 2014 we would be in the same position as Ireland, horrified at what our neighbour is about to do to themselves but making preparations to protect our interests, with the solidarity of a global A-Team behind us.

Throughout the Brexit process the EU27 has been professional and disciplined.

A withdrawal agreement predicated on Mrs May’s red lines now exists and was agreed by them and her – it is a done deal as far as they are concerned. The big problem is the Tory UK Government and their apologists. I have survived three “Brexit Days” – March 29, April 12 and May 22. When the extension to the negotiating period was given, EU president Donald Tusk – a real friend of Scotland and indeed the UK – said “do not waste this time,” yet that is exactly what the Tories have done.

READ MORE: Scotland hit harder than London by Brexit, think tank says

Like many in Scotland, and indeed elsewhere, I have found the Tory leadership contest so utterly dispiriting I can barely put it into words. The grim spectacle of the BBC debate last week was a new low, it was like something out of Soviet Russia or Yugoslavia.

And the state broadcaster only lent credence to a gruesome, self regarding process where we are not participants but grunt bystanders. The Tory leadership contest has nothing to do with us. We have no opportunity to vote in it or participate in any meaningful way.

Except it does matter in that it will result in the new prime minister of the state Scotland is still a part of. This is a contest by the Tories for the Tories, to be decided by a tiny amount of people who are so unrepresentative of society I am struggling to find a comparison.

I don’t know how the Flat Earth Society choose their president (if indeed they have one) but good luck to them. However, the identity of the President of the Flat Earth Society has little bearing on my life – this does.

And the Tories are assuredly flat-Earthers, this contest proves that. Otherwise rational people have taken leave of their senses, competing with each other to offer ever more outlandish prospects as if the last three years never happened.

I have also been shocked at the venality of the Tory MPs in their participation in the debate. They have likewise fallen over themselves to outdo each other in entirely unrealistic aspiration, doublethink and evasion.

I really felt for Gary Robertson on Good Morning Scotland on Wednesday trying to get two Tory MPs to give a straight answer to what were really straightforward questions.

It is not just the emperor who has no clothes, it is the entire Tory Party (and apologies for that image).

What happens next? The options, when reality dawns on whoever the Tories crown their leader, are the same as ever they were: leave with a deal or leave with no deal, or revoke Article 50 either by vote in the House of Commons or by referendum. That’s it. There are no unicorns or hordes of magic elves going to come running over the horizon to aid the battle. The battle is done, you want Brexit, here it is in black and white.

The National:

There is no scope for renegotiation, there just isn’t. In Brussels the Article 50 task force has been all but wound up, the personnel gratefully reallocated to different functions across the Commission.

There is scope, given that “the deal” is two documents – the withdrawal agreement itself and an annexed political declaration – for some cosmetic changes to the political declaration.

It is already an aspirational document trying to pin down some of the general principles for the future relationship.

It could easily have some additional, shinier, exciting and whizzy aspirations added in to it.

But would that be sufficient to get it through a hopelessly deadlocked House of Commons? The EU will not budge on the hated backstop, given that they have Dublin’s back in preserving the Good Friday Agreement.Would the DUP, not known for their flexibility, budge instead to do a favour for the Tories?

Could a new prime minister bludgeon it through in a way that May, with the full force of the British state behind her, could not?

I can’t see it. For my part I think both a no deal and a referendum have become more likely in the last few weeks. It is open to the UK to unilaterally revoke Article 50 – the court case I and five other Scottish parliamentarians took to the European Court of Justice proved that – but I don’t see the arithmetic for it in the Commons, yet.

But a referendum might well present itself as a way out (for now) for all sides. The new PM will, surely, not want to expend much capital on May’s loathed deal but will soon realise it is the only deal on the table. A referendum, grandly described as putting the people in charge could easily be dressed up as the answer.

From the Remain side, bringing it back to the people is the chance to win the argument. I’d suggest that May’s deal versus Remain is eminently winnable.

At the European Parliament, recent weeks have been a blur with my new colleagues Christian Allard and Aileen McLeod hitting the ground running in Brussels.

I was honoured to be elected President of our political group at the European parliament and also as first vice-president of the Green/EFA group we form with the European Greens, giving us some real heft in the future discussions. But of course from a Scottish perspective, I want to see Scotland independent. So we’re preparing the research and the ground for either an EU referendum, or the EU aspects of an independence one.

Watch this space.