mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -07:00
Move common libs to libs/common
This commit is contained in:
parent
8dbb1a2451
commit
1f4bd41bcc
1612 changed files with 962 additions and 10 deletions
34
libs/common/guessit/monkeypatch.py
Normal file
34
libs/common/guessit/monkeypatch.py
Normal file
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Monkeypatch initialisation functions
|
||||
"""
|
||||
|
||||
try:
|
||||
from collections import OrderedDict
|
||||
except ImportError: # pragma: no-cover
|
||||
from ordereddict import OrderedDict # pylint:disable=import-error
|
||||
|
||||
from rebulk.match import Match
|
||||
|
||||
|
||||
def monkeypatch_rebulk():
|
||||
"""Monkeypatch rebulk classes"""
|
||||
|
||||
@property
|
||||
def match_advanced(self):
|
||||
"""
|
||||
Build advanced dict from match
|
||||
:param self:
|
||||
:return:
|
||||
"""
|
||||
|
||||
ret = OrderedDict()
|
||||
ret['value'] = self.value
|
||||
if self.raw:
|
||||
ret['raw'] = self.raw
|
||||
ret['start'] = self.start
|
||||
ret['end'] = self.end
|
||||
return ret
|
||||
|
||||
Match.advanced = match_advanced
|
Loading…
Add table
Add a link
Reference in a new issue