The court heard that police received information that McCulloch was growing the illegal drug so executed a search warrant for her home on October 4.

Inside, they found seven larger plants, three smaller ones and 17 cuttings which had been planted in small pots on a bedroom window sill.

Fiscal Paula Forbes said that tests placed a total potential value on the plants, if all had fully grown and been sold at their street value, of £15,120.

She added: “The court is willing to accept that many of these cuttings were indeed just that, and would have had to reach full maturity to be worth the values given. In the condition they were found, they had very little value.”

Police also found almost £40 of cannabis and cocaine worth around £100.

Solicitor Paul Feeney said McCulloch bought a home growing kit online for £150 in the hope of growing her own cannabis and avoiding having to use the local dealers. He added that the former electrician had lost her job, and that the cost of supplying her habit was “quite considerable”.

Sheriff Kenneth Robb told McCulloch: “I have to work on a speculative basis as to what would happen to these cuttings had police not intervened.”

In a separate incident, a 20-year-old man from 76 McDowall Drive in Stranraer also faced charges of growing cannabis.

David Gladstone also bought a home-growing kit for £200 from the internet.

The court was told that intelligence was received by police pointing to Gladstone growing the illegal plants in his home.

When officers arrived to search his house, he admitted the offence and said his partner knew nothing about it. In his attic, he had three plants in pots in a small growing tent, all described by fiscal Paula Forbes as a “small but sophisticated cannabis cultivation operation”.

Lawyer Paul Feeney said Gladstone had also grown his own drugs to avoid dealing with local suppliers. He added that he had bought five seeds but threw two away, as three plants was plenty for his own needs.

The court placed a value on the plants at full maturity of £1680.

Sheriff Kenneth Robb said he would impose a community payback order and place Gladstone on a nine-month supervision order “as a direct alternative to jail” this time.