@@ -144,11 +144,12 @@ def sync_repo(self):
144
144
identifier = self .version .identifier ,
145
145
)
146
146
log .info (
147
- LOG_TEMPLATE .format (
148
- project = self .project .slug ,
149
- version = self .version .slug ,
150
- msg = msg ,
151
- ),
147
+ LOG_TEMPLATE ,
148
+ {
149
+ 'project' : self .project .slug ,
150
+ 'version' : self .version .slug ,
151
+ 'msg' : msg ,
152
+ }
152
153
)
153
154
version_repo = self .get_vcs_repo ()
154
155
version_repo .update ()
@@ -484,11 +485,12 @@ def run_setup(self, record=True):
484
485
self .setup_env .failure ,
485
486
)
486
487
log .info (
487
- LOG_TEMPLATE .format (
488
- project = self .project .slug ,
489
- version = self .version .slug ,
490
- msg = msg ,
491
- ),
488
+ LOG_TEMPLATE ,
489
+ {
490
+ 'project' : self .project .slug ,
491
+ 'version' : self .version .slug ,
492
+ 'msg' : msg ,
493
+ }
492
494
)
493
495
494
496
# Send notification to users only if the build didn't fail because
@@ -545,11 +547,12 @@ def run_build(self, docker, record):
545
547
python_env_cls = Virtualenv
546
548
if self .config .conda is not None :
547
549
log .info (
548
- LOG_TEMPLATE .format (
549
- project = self .project .slug ,
550
- version = self .version .slug ,
551
- msg = 'Using conda' ,
552
- ),
550
+ LOG_TEMPLATE ,
551
+ {
552
+ 'project' : self .project .slug ,
553
+ 'version' : self .version .slug ,
554
+ 'msg' : 'Using conda' ,
555
+ }
553
556
)
554
557
python_env_cls = Conda
555
558
self .python_env = python_env_cls (
@@ -624,11 +627,12 @@ def setup_vcs(self):
624
627
self .setup_env .update_build (state = BUILD_STATE_CLONING )
625
628
626
629
log .info (
627
- LOG_TEMPLATE .format (
628
- project = self .project .slug ,
629
- version = self .version .slug ,
630
- msg = 'Updating docs from VCS' ,
631
- ),
630
+ LOG_TEMPLATE ,
631
+ {
632
+ 'project' : self .project .slug ,
633
+ 'version' : self .version .slug ,
634
+ 'msg' : 'Updating docs from VCS' ,
635
+ }
632
636
)
633
637
try :
634
638
self .sync_repo ()
@@ -1028,11 +1032,12 @@ def move_files(
1028
1032
storage .delete (storage_path )
1029
1033
1030
1034
log .debug (
1031
- LOG_TEMPLATE .format (
1032
- project = version .project .slug ,
1033
- version = version .slug ,
1034
- msg = 'Moving files' ,
1035
- ),
1035
+ LOG_TEMPLATE ,
1036
+ {
1037
+ 'project' : version .project .slug ,
1038
+ 'version' : version .slug ,
1039
+ 'msg' : 'Moving files' ,
1040
+ }
1036
1041
)
1037
1042
1038
1043
if html :
@@ -1178,24 +1183,26 @@ def fileify(version_pk, commit):
1178
1183
1179
1184
if not commit :
1180
1185
log .warning (
1181
- LOG_TEMPLATE .format (
1182
- project = project .slug ,
1183
- version = version .slug ,
1184
- msg = (
1186
+ LOG_TEMPLATE ,
1187
+ {
1188
+ 'project' : project .slug ,
1189
+ 'version' : version .slug ,
1190
+ 'msg' : (
1185
1191
'Search index not being built because no commit information'
1186
1192
),
1187
- ),
1193
+ }
1188
1194
)
1189
1195
return
1190
1196
1191
1197
path = project .rtd_build_path (version .slug )
1192
1198
if path :
1193
1199
log .info (
1194
- LOG_TEMPLATE .format (
1195
- project = version .project .slug ,
1196
- version = version .slug ,
1197
- msg = 'Creating ImportedFiles' ,
1198
- ),
1200
+ LOG_TEMPLATE ,
1201
+ {
1202
+ 'project' : version .project .slug ,
1203
+ 'version' : version .slug ,
1204
+ 'msg' : 'Creating ImportedFiles' ,
1205
+ }
1199
1206
)
1200
1207
try :
1201
1208
_manage_imported_files (version , path , commit )
@@ -1414,11 +1421,12 @@ def email_notification(version, build, email):
1414
1421
:param email: Email recipient address
1415
1422
"""
1416
1423
log .debug (
1417
- LOG_TEMPLATE .format (
1418
- project = version .project .slug ,
1419
- version = version .slug ,
1420
- msg = 'sending email to: %s' % email ,
1421
- ),
1424
+ LOG_TEMPLATE ,
1425
+ {
1426
+ 'project' : version .project .slug ,
1427
+ 'version' : version .slug ,
1428
+ 'msg' : 'sending email to: %s' % email ,
1429
+ }
1422
1430
)
1423
1431
1424
1432
# We send only what we need from the Django model objects here to avoid
@@ -1482,11 +1490,12 @@ def webhook_notification(version, build, hook_url):
1482
1490
},
1483
1491
})
1484
1492
log .debug (
1485
- LOG_TEMPLATE .format (
1486
- project = project .slug ,
1487
- version = '' ,
1488
- msg = 'sending notification to: %s' % hook_url ,
1489
- ),
1493
+ LOG_TEMPLATE ,
1494
+ {
1495
+ 'project' : project .slug ,
1496
+ 'version' : '' ,
1497
+ 'msg' : 'sending notification to: %s' % hook_url ,
1498
+ }
1490
1499
)
1491
1500
try :
1492
1501
requests .post (hook_url , data = data )
@@ -1515,11 +1524,12 @@ def update_static_metadata(project_pk, path=None):
1515
1524
path = project .static_metadata_path ()
1516
1525
1517
1526
log .info (
1518
- LOG_TEMPLATE .format (
1519
- project = project .slug ,
1520
- version = '' ,
1521
- msg = 'Updating static metadata' ,
1522
- ),
1527
+ LOG_TEMPLATE ,
1528
+ {
1529
+ 'project' : project .slug ,
1530
+ 'version' : '' ,
1531
+ 'msg' : 'Updating static metadata' ,
1532
+ }
1523
1533
)
1524
1534
translations = [trans .language for trans in project .translations .all ()]
1525
1535
languages = set (translations )
@@ -1538,11 +1548,12 @@ def update_static_metadata(project_pk, path=None):
1538
1548
fh .close ()
1539
1549
except (AttributeError , IOError ) as e :
1540
1550
log .debug (
1541
- LOG_TEMPLATE .format (
1542
- project = project .slug ,
1543
- version = '' ,
1544
- msg = 'Cannot write to metadata.json: {}' .format (e ),
1545
- ),
1551
+ LOG_TEMPLATE ,
1552
+ {
1553
+ 'project' : project .slug ,
1554
+ 'version' : '' ,
1555
+ 'msg' : 'Cannot write to metadata.json: {}' .format (e ),
1556
+ }
1546
1557
)
1547
1558
1548
1559
0 commit comments