Skip to content

Commit 45273f7

Browse files
authored
add previousVersions (#8)
* process lastUpdated * fix field name
1 parent 3cc4e7d commit 45273f7

File tree

4 files changed

+25
-27
lines changed

4 files changed

+25
-27
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ Additional fields are
3535
* `override` - This is an object, where any component field values will replace the existing field values. For example, libraries in the `broken.conf` file are outdated, and we want to cap the
3636
`maxRevision` to `228`. This cap can be applied by setting `override` to {`maxRevision`: `228`}
3737
* `log` - Any notes of explanation, such as why a library was labeled `BROKEN`
38+
* These fields are included, but the data is not comprehensive. It would require pulling data from the archives.
39+
* `previousVersions` - a list of previous `prettyVersion` values. This will be added whenever a new
40+
library is updated. To have complete data for this field will require some detective work into the archives.
41+
* `dateAdded` - Date library was added to contributions. This will be added whenever a new library is
42+
added. To have complete data for this field will require some detective work into the archives.
43+
* `lastUpdated` - Date library was last updated in the repo. This will be added whenever a library is
44+
updated. To have complete data for this field will require waiting for all libraries to be updated, or
45+
will require some detective work into the archives.
3846

3947
## Scripts
4048
The scripts folder contains scripts in Python for parsing, validating, and processing the database

contributions.yaml

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,8 +2042,7 @@ contributions:
20422042
prettyVersion: 0.7.0
20432043
minRevision: 0
20442044
maxRevision: 0
2045-
lastUpdated: '0'
2046-
download:
2045+
download:
20472046
https://github.com/cansik/opencv-processing/releases/download/contribution-manager/opencv_processing.zip
20482047
override:
20492048
categories:
@@ -2433,8 +2432,7 @@ contributions:
24332432
prettyVersion: 2.4.0
24342433
minRevision: 229
24352434
maxRevision: 0
2436-
lastUpdated: '0'
2437-
download:
2435+
download:
24382436
https://github.com/processing/processing-sound/releases/download/latest/sound.zip
24392437
override:
24402438
categories:
@@ -2565,7 +2563,6 @@ contributions:
25652563
prettyVersion: 0.2.2
25662564
minRevision: 242
25672565
maxRevision: 0
2568-
lastUpdated: '1443010051000'
25692566
download: https://github.com/joelmoniz/Git-Manager/releases/download/latest/GitManager.zip
25702567
- id: 161
25712568
source: http://codigogenerativo.com/KinectPV2.txt
@@ -2610,7 +2607,6 @@ contributions:
26102607
minRevision: 242
26112608
maxRevision: 0
26122609
imports: processing.mode.java.JavaMode
2613-
lastUpdated: '1443120511000'
26142610
download: https://github.com/joelmoniz/REPLmode/releases/download/latest/REPLMode.zip
26152611
- id: 163
26162612
source: http://shiffman.net/p5/examples/learningprocessing2.txt
@@ -2954,8 +2950,7 @@ contributions:
29542950
prettyVersion: 0.8.0
29552951
minRevision: 245
29562952
maxRevision: 0
2957-
lastUpdated: '1455510195000'
2958-
download:
2953+
download:
29592954
https://github.com/joelmoniz/Shape-Sketch/releases/download/latest/ShapeSketch.zip
29602955
- id: 182
29612956
source:
@@ -3189,7 +3184,6 @@ contributions:
31893184
prettyVersion: '1.0'
31903185
minRevision: 0
31913186
maxRevision: 0
3192-
lastUpdated: '0'
31933187
download: http://damellis.github.io/wovns-processing-examples/WOVNS.zip
31943188
- id: 195
31953189
source: http://culebra.technology/culebra.txt
@@ -3460,8 +3454,7 @@ contributions:
34603454
prettyVersion: 0.1.1
34613455
minRevision: 0
34623456
maxRevision: 0
3463-
lastUpdated: '0'
3464-
download:
3457+
download:
34653458
https://github.com/Lord-of-the-Galaxy/Timing-Utilities/releases/download/latest/timing_utils.zip
34663459
override:
34673460
categories:
@@ -3631,7 +3624,6 @@ contributions:
36313624
prettyVersion: '1.02'
36323625
minRevision: 0
36333626
maxRevision: 0
3634-
lastUpdated: '0'
36353627
download: http://maxlfarrell.gitlab.io/extruder/extruder.zip
36363628
override:
36373629
categories:
@@ -3865,8 +3857,7 @@ contributions:
38653857
prettyVersion: '1.0'
38663858
minRevision: 0
38673859
maxRevision: 0
3868-
lastUpdated: '0'
3869-
download:
3860+
download:
38703861
https://github.com/Apress/processing-for-android/releases/download/latest/processing-for-android-examples.zip
38713862
- id: 227
38723863
source:
@@ -4054,7 +4045,6 @@ contributions:
40544045
prettyVersion: 2.0.0
40554046
minRevision: 228
40564047
maxRevision: 0
4057-
lastUpdated: '0'
40584048
download: http://gicentre.org/handy/handy.zip
40594049
override:
40604050
categories:
@@ -4409,7 +4399,6 @@ contributions:
44094399
prettyVersion: v1.0.7
44104400
minRevision: 0
44114401
maxRevision: 0
4412-
lastUpdated: '0'
44134402
download: http://www.kramann.info/ComposingForEveryone.zip
44144403
override:
44154404
categories:
@@ -4598,7 +4587,6 @@ contributions:
45984587
prettyVersion: 2.0.0
45994588
minRevision: 0
46004589
maxRevision: 0
4601-
lastUpdated: '0'
46024590
download: https://codingart-book.github.io/examples/CodingArtBookExamples.zip
46034591
override:
46044592
categories:
@@ -4710,7 +4698,6 @@ contributions:
47104698
prettyVersion: 0.1.1
47114699
minRevision: 0
47124700
maxRevision: 0
4713-
lastUpdated: '0'
47144701
download: https://www.robertesler.com/software/Pd4P3.zip
47154702
override:
47164703
categories:
@@ -4734,8 +4721,7 @@ contributions:
47344721
prettyVersion: 1.0.0
47354722
minRevision: 266
47364723
maxRevision: 0
4737-
lastUpdated: '0'
4738-
download:
4724+
download:
47394725
https://fox-gieg.com/patches/processing/libraries/latkProcessing/latkProcessing.zip
47404726
override:
47414727
categories:
@@ -4979,7 +4965,6 @@ contributions:
49794965
prettyVersion: 1.0.0
49804966
minRevision: 266
49814967
maxRevision: 0
4982-
lastUpdated: '0'
49834968
download: https://fox-gieg.com/patches/processing/libraries/joons/joons.zip
49844969
override:
49854970
categories:
@@ -5090,8 +5075,7 @@ contributions:
50905075
prettyVersion: 1.1.0
50915076
minRevision: 400
50925077
maxRevision: 0
5093-
lastUpdated: '0'
5094-
download:
5078+
download:
50955079
https://github.com/letorbi/discord-rich-presence-for-processing/releases/latest/download/DiscordRichPresence.zip
50965080
- id: 289
50975081
source:
@@ -5170,8 +5154,7 @@ contributions:
51705154
prettyVersion: '2.0'
51715155
minRevision: 0
51725156
maxRevision: 0
5173-
lastUpdated: '0'
5174-
download:
5157+
download:
51755158
https://github.com/Apress/Processing-for-Android-Second-Edition/releases/download/latest/processing-for-android-examples.zip
51765159
override:
51775160
categories:

scripts/add_new_contribution_to_yaml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
contribution = {
4343
'id': max_index + 1,
4444
'status': 'VALID',
45-
'date_added': datetime_today,
45+
'dateAdded': datetime_today,
4646
}
4747
contribution.update(props)
4848

scripts/fetch_updates.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010

1111
def update_contribution(contribution, props):
1212
datetime_today = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S%z')
13-
contribution['last_updated'] = datetime_today
13+
contribution['lastUpdated'] = datetime_today
14+
if 'previousVersions' not in contribution:
15+
contribution['previousVersions'] = []
16+
contribution['previousVersions'].append(contribution['prettyVersion'])
1417

1518
# update from online
1619
for field in props.keys():
@@ -58,6 +61,10 @@ def process_contribution(contribution):
5861
log_broken(contribution, f'invalid file, {date_today}')
5962
return
6063

64+
# some library files have field lastUpdated. This also exists in the database, but is defined
65+
# by our scripts, so remove this field.
66+
contribution.pop('lastUpdated', None)
67+
6168
contribution['status'] = 'VALID'
6269

6370
if props['version'] != this_version:

0 commit comments

Comments
 (0)