BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xml-python-examples
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
xml-python-examples
Commits
0ca9abf8
Commit
0ca9abf8
authored
Feb 21, 2019
by
Forest Godfrey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reverse order of output
parent
ea8f5790
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
posts.py
posts.py
+6
-3
No files found.
posts.py
View file @
0ca9abf8
...
@@ -34,11 +34,14 @@ def process_post(post):
...
@@ -34,11 +34,14 @@ def process_post(post):
tree
=
ET
.
parse
(
'/tmp/posts.xml'
)
tree
=
ET
.
parse
(
'/tmp/posts.xml'
)
root
=
tree
.
getroot
()
root
=
tree
.
getroot
()
outposts
=
[]
for
post
in
root
.
findall
(
'post'
):
post_url
,
post_text
=
process_post
(
post
)
outposts
=
[(
post_url
,
post_text
)]
+
outposts
d
=
datetime
.
datetime
(
2019
,
2
,
21
,
17
,
0
)
d
=
datetime
.
datetime
(
2019
,
2
,
21
,
17
,
0
)
t
=
timedelta
(
0
,
30
*
60
,
0
)
t
=
timedelta
(
0
,
30
*
60
,
0
)
for
post
in
root
.
findall
(
'post'
)
:
for
post
_url
,
post_text
in
outposts
:
post_time
=
d
.
strftime
(
"
%
m/
%
d/
%
Y
%
H:
%
M"
)
post_time
=
d
.
strftime
(
"
%
m/
%
d/
%
Y
%
H:
%
M"
)
post_url
,
post_text
=
process_post
(
post
)
d
=
d
+
t
d
=
d
+
t
print
"
%
s,
%
s,
%
s"
%
(
post_time
,
post_text
,
post_url
)
print
"
%
s,
%
s,
%
s"
%
(
post_time
,
post_text
,
post_url
)
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