Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mason-today-web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
8
Issues
8
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SRCT
mason-today-web
Commits
2fdcdada
Commit
2fdcdada
authored
May 14, 2018
by
Zach Osman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding simple quality testing function
parent
ef0a3684
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
mason-today/parscript.py
mason-today/parscript.py
+19
-3
No files found.
mason-today/parscript.py
View file @
2fdcdada
...
...
@@ -26,7 +26,22 @@ def cleanup(dirtystring):
dirtystring
=
dirtystring
.
replace
(
replacement
[
0
],
replacement
[
1
])
return
dirtystring
[:
-
1
]
# Simple event quality test
def
qualityTest
(
desc
):
# none, bad, okay, good
length
=
len
(
desc
)
if
length
<
10
:
return
"none"
elif
length
<
40
:
return
"bad"
elif
length
<
80
:
return
"okay"
elif
length
<
100
:
return
"good"
else
:
return
"?"
# convertTime accepts strings in the form of ""
def
convertTime
(
stri
):
# this function is used for splicing the event times.
...
...
@@ -251,9 +266,10 @@ def load_data():
print description
print "----------------------------------------------------------------------------"
'''
if
(
error
==
[]):
dictlist
.
append
({
"id"
:
uniqueid
,
"title"
:
entry_title
,
"dayofweek"
:
day
,
"dayofmonth"
:
monthday
,
"month"
:
month
,
"year"
:
year
,
"timestart"
:
timestart
,
"timestop"
:
timestop
,
"location"
:
location
,
"description"
:
description
})
quality
=
qualityTest
(
description
)
dictlist
.
append
({
"id"
:
uniqueid
,
"quality"
:
quality
,
"title"
:
entry_title
,
"dayofweek"
:
day
,
"dayofmonth"
:
monthday
,
"month"
:
month
,
"year"
:
year
,
"timestart"
:
timestart
,
"timestop"
:
timestop
,
"location"
:
location
,
"description"
:
description
})
else
:
dictlist
.
append
({
"id"
:
uniqueid
,
"error"
:
error
})
return
dictlist
...
...
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