Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tarik Graba
csv2ics
Commits
0ba04a5f
Commit
0ba04a5f
authored
Aug 23, 2019
by
Tarik Graba
😷
Browse files
Better when everything is written in one language
parent
17baff68
Changes
1
Hide whitespace changes
Inline
Side-by-side
csv2ics.py
View file @
0ba04a5f
...
@@ -38,16 +38,16 @@ cal = Calendar()
...
@@ -38,16 +38,16 @@ cal = Calendar()
cal
[
'summary'
]
=
SUMMARY
cal
[
'summary'
]
=
SUMMARY
with
open
(
CSV_FNAME
)
as
csvfile
:
with
open
(
CSV_FNAME
)
as
csvfile
:
seanc
es
=
csv
.
reader
(
csvfile
,
delimiter
=
';'
,
quotechar
=
'"'
)
lin
es
=
csv
.
reader
(
csvfile
,
delimiter
=
';'
,
quotechar
=
'"'
)
# Skip the header
# Skip the header
entete
=
next
(
seanc
es
)
header
=
next
(
lin
es
)
for
seance
in
seanc
es
:
for
line
in
lin
es
:
event
=
Event
()
event
=
Event
()
description
=
seanc
e
[
6
]
description
=
lin
e
[
6
]
date_
debu
t
=
" "
.
join
([
seanc
e
[
0
],
seanc
e
[
2
]])
date_
star
t
=
" "
.
join
([
lin
e
[
0
],
lin
e
[
2
]])
date_
fin
=
" "
.
join
([
seanc
e
[
0
],
seanc
e
[
3
]])
date_
end
=
" "
.
join
([
lin
e
[
0
],
lin
e
[
3
]])
ddate_d
=
date_locale
.
localize
(
datetime
.
strptime
(
date_
debu
t
,
date_fmt
))
ddate_d
=
date_locale
.
localize
(
datetime
.
strptime
(
date_
star
t
,
date_fmt
))
ddate_f
=
date_locale
.
localize
(
datetime
.
strptime
(
date_
fin
,
date_fmt
))
ddate_f
=
date_locale
.
localize
(
datetime
.
strptime
(
date_
end
,
date_fmt
))
event
.
add
(
'summary'
,
description
)
event
.
add
(
'summary'
,
description
)
event
.
add
(
'dtstart'
,
ddate_d
)
event
.
add
(
'dtstart'
,
ddate_d
)
event
.
add
(
'dtend'
,
ddate_f
)
event
.
add
(
'dtend'
,
ddate_f
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment