Better detection of vcards
This commit is contained in:
parent
f37c3a0b27
commit
36918232c0
@ -390,12 +390,17 @@ class Collection(object):
|
|||||||
with self.props as props:
|
with self.props as props:
|
||||||
if "tag" not in props:
|
if "tag" not in props:
|
||||||
try:
|
try:
|
||||||
props["tag"] = open(self.path).readlines()[0][6:].rstrip()
|
tag = open(self.path).readlines()[0][6:].rstrip()
|
||||||
except IOError:
|
except IOError:
|
||||||
if self.path.endswith(".vcf"):
|
if self.path.endswith(".vcf"):
|
||||||
props["tag"] = "VADDRESSBOOK"
|
props["tag"] = "VADDRESSBOOK"
|
||||||
else:
|
else:
|
||||||
props["tag"] = "VCALENDAR"
|
props["tag"] = "VCALENDAR"
|
||||||
|
else:
|
||||||
|
if tag in ("VADDRESSBOOK", "VCARD"):
|
||||||
|
props["tag"] = "VADDRESSBOOK"
|
||||||
|
else:
|
||||||
|
props["tag"] = "VCALENDAR"
|
||||||
return props["tag"]
|
return props["tag"]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user