Dunfermline Sheriff Court heard of how James Homer subjected his then-partner to years of abuse.