Skip to content

Commit

Permalink
Merge pull request #157 from olamidepeterojo/datetime
Browse files Browse the repository at this point in the history
Fix the deprecation status of the datetime library usage
  • Loading branch information
gridhead authored Jan 23, 2025
2 parents 02cb7e0 + 624ea7f commit b0e6e3a
Show file tree
Hide file tree
Showing 45 changed files with 4,280 additions and 3,969 deletions.
26 changes: 13 additions & 13 deletions pagure_exporter/work/tkts.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


import time
from datetime import datetime
from datetime import datetime, timezone

import requests
from gitlab import GitlabCreateError, GitlabGetError, GitlabUpdateError
Expand Down Expand Up @@ -152,12 +152,12 @@ def itertkts(self, dictobjc):
repolink=standard.srcedict["repolink"],
authname=standard.authname,
authlink=standard.authlink,
dateinfo=datetime.utcfromtimestamp(standard.timedata).strftime("%c"),
mo=datetime.utcfromtimestamp(standard.timedata).strftime("%b").lower(),
dd=datetime.utcfromtimestamp(standard.timedata).strftime("%d"),
yy=datetime.utcfromtimestamp(standard.timedata).strftime("%Y"),
hh=datetime.utcfromtimestamp(standard.timedata).strftime("%H"),
mm=datetime.utcfromtimestamp(standard.timedata).strftime("%M"),
dateinfo=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%c"),
mo=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%b").lower(),
dd=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%d"),
yy=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%Y"),
hh=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%H"),
mm=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%M"),
)
"""
Replace "@" in the `bodydata` with "&" to ensure that wrong people are not referenced
Expand Down Expand Up @@ -199,12 +199,12 @@ def itercmts(self, dictobjc):
issulink=standard.issulink,
reponame=standard.srcename,
repolink=standard.srcedict["repolink"],
dateinfo=datetime.utcfromtimestamp(standard.cmtstime).strftime("%c"),
mo=datetime.utcfromtimestamp(standard.cmtstime).strftime("%b").lower(),
dd=datetime.utcfromtimestamp(standard.cmtstime).strftime("%d"),
yy=datetime.utcfromtimestamp(standard.cmtstime).strftime("%Y"),
hh=datetime.utcfromtimestamp(standard.cmtstime).strftime("%H"),
mm=datetime.utcfromtimestamp(standard.cmtstime).strftime("%M"),
dateinfo=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%c"),
mo=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%b").lower(),
dd=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%d"),
yy=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%Y"),
hh=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%H"),
mm=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%M"),
)
"""
Replace "@" in the `bodydata` with "&" to ensure that wrong people are not referenced
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ interactions:
Content-Length:
- '902'
Content-Security-Policy:
- default-src 'self';script-src 'self' 'nonce-gnpc6782vkYnICzjURP0nU1Md'; style-src
'self' 'nonce-gnpc6782vkYnICzjURP0nU1Md'; object-src 'none';base-uri 'self';img-src
- default-src 'self';script-src 'self' 'nonce-LxHuIDKJllBnZbwocuFyGLOih'; style-src
'self' 'nonce-LxHuIDKJllBnZbwocuFyGLOih'; object-src 'none';base-uri 'self';img-src
'self' https:;connect-src 'self' https://pagure.io:8088;frame-src https://docs.pagure.org;frame-ancestors
https://pagure.io;
Content-Type:
- application/json
Date:
- Mon, 20 Jan 2025 05:49:26 GMT
- Thu, 23 Jan 2025 09:33:53 GMT
Keep-Alive:
- timeout=5, max=100
Referrer-Policy:
Expand Down Expand Up @@ -84,7 +84,7 @@ interactions:
CF-Cache-Status:
- MISS
CF-Ray:
- 904cc801eba733a8-DEL
- 9066c8ebef963390-DEL
Cache-Control:
- no-cache
Connection:
Expand All @@ -94,11 +94,11 @@ interactions:
Content-Type:
- application/json
Date:
- Mon, 20 Jan 2025 05:49:27 GMT
- Thu, 23 Jan 2025 09:33:54 GMT
NEL:
- '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}'
Report-To:
- '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=csvRLVgHkTyrD2CCR9rm%2F4HDR24Mj7dzjCqbcPecWjbl9AsCeNQtd1qpO3CGWvx7Z7ez93nFqWK4Ix0vW8CL5emLl3C5uNGTLIS%2FGKxmfcgLpf9ReD9FqW30vq7rWPyfcgMncVTL%2Fs0%3D"}],"group":"cf-nel","max_age":604800}'
- '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=QAkS%2BBMgw2htd75IP9H3WVBTjcd3r5B6Gm2FWkQERc%2BnXBXyJom1hVAx70XTsJ0Kxv%2BEMiT0ewDHcammTrsj3oMrFOkcqcLXpMaGUWAfYNIkQIX8kY7hps61DR7OYf5slLtaf1%2BU3ZE%3D"}],"group":"cf-nel","max_age":604800}'
Server:
- cloudflare
Set-Cookie: ''
Expand All @@ -109,21 +109,21 @@ interactions:
content-security-policy:
- default-src 'none'
gitlab-lb:
- haproxy-main-41-lb-gprd
- haproxy-main-01-lb-gprd
gitlab-sv:
- api-gke-us-east1-d
- api-gke-us-east1-c
referrer-policy:
- strict-origin-when-cross-origin
x-content-type-options:
- nosniff
x-frame-options:
- SAMEORIGIN
x-gitlab-meta:
- '{"correlation_id":"dbc4a2a934da81ab1a6e2a97c7a2d70a","version":"1"}'
- '{"correlation_id":"dadc7b39d61f7fee8f1ca96dd05f28d6","version":"1"}'
x-request-id:
- dbc4a2a934da81ab1a6e2a97c7a2d70a
- dadc7b39d61f7fee8f1ca96dd05f28d6
x-runtime:
- '0.025286'
- '0.023117'
status:
code: 401
message: Unauthorized
Expand Down
Loading

0 comments on commit b0e6e3a

Please sign in to comment.