Sean Iles, procurator fiscal depute, said: “Police had reason to attend at the address and found the front door secured. They saw the accused was lying inside the property at the foot of the stairs behind the front door.
"Emergency services were then asked to attend and police forced entry. The accused was roused by officers and became aggressive with them. He attempted to kick one officer and, due to this, was handcuffed.
"He then spat on a police officer, hitting him in the face.”
Defence solicitor Simon Hutchison stated McGinley had “changed his life” since the incident.
"It’s very rare to see he’s not been in trouble for 12 months,” he added.
Sheriff Derek Livingston ordered McGinley to complete 81 hours unpaid work within six months.