mirror of
https://gitlab.crans.org/mediatek/med.git
synced 2024-11-26 22:47:09 +00:00
Fixed publish date when there is only the year
This commit is contained in:
parent
92dc21f014
commit
343ab02874
@ -72,6 +72,9 @@ class MediaAdminForm(ModelForm):
|
|||||||
"June", "July", "August", "September",
|
"June", "July", "August", "September",
|
||||||
"October", "November", "December"]
|
"October", "November", "December"]
|
||||||
split = data['publish_date'].replace(',', '').split(' ')
|
split = data['publish_date'].replace(',', '').split(' ')
|
||||||
|
if len(split) == 1:
|
||||||
|
self.cleaned_data['publish_date'] = split[0] + "-01-01"
|
||||||
|
else:
|
||||||
self.cleaned_data['publish_date'] = "{}-{:02d}-{:02d}" \
|
self.cleaned_data['publish_date'] = "{}-{:02d}-{:02d}" \
|
||||||
.format(split[2], months.index(split[0]) + 1,
|
.format(split[2], months.index(split[0]) + 1,
|
||||||
int(split[1]), )
|
int(split[1]), )
|
||||||
|
@ -2,6 +2,7 @@ from http.server import BaseHTTPRequestHandler, HTTPServer
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import socket
|
import socket
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
"""
|
"""
|
||||||
GetBlue Android parameters
|
GetBlue Android parameters
|
||||||
@ -24,6 +25,8 @@ class Server(BaseHTTPRequestHandler):
|
|||||||
print("Hey j'ai un ISBN :", isbn)
|
print("Hey j'ai un ISBN :", isbn)
|
||||||
os.system("xdotool type " + isbn)
|
os.system("xdotool type " + isbn)
|
||||||
os.system("xdotool key KP_Enter")
|
os.system("xdotool key KP_Enter")
|
||||||
|
sleep(1)
|
||||||
|
os.system("xdotool click 1")
|
||||||
|
|
||||||
def do_HEAD(self):
|
def do_HEAD(self):
|
||||||
self._set_headers()
|
self._set_headers()
|
||||||
|
Loading…
Reference in New Issue
Block a user