mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-02-13 23:14:14 -05:00
long_type (regex)
long_type( int(
This commit is contained in:
parent
219a0d99f3
commit
2a9ea4550f
@ -24,7 +24,6 @@ from calibre.devices.usbms.device import USBDevice
|
||||
from calibre.devices.usbms.driver import USBMS
|
||||
from calibre.ebooks.metadata import authors_to_sort_string, authors_to_string
|
||||
from calibre.prints import debug_print
|
||||
from polyglot.builtins import long_type
|
||||
|
||||
DBPATH = 'Sony_Reader/database/books.db'
|
||||
THUMBPATH = 'Sony_Reader/database/cache/books/%s/thumbnail/main_thumbnail.jpg'
|
||||
@ -330,7 +329,7 @@ class PRST1(USBMS):
|
||||
cursor.execute(query)
|
||||
row = cursor.fetchone()
|
||||
|
||||
return long_type(row[0])
|
||||
return int(row[0])
|
||||
|
||||
def get_database_min_id(self, source_id):
|
||||
sequence_min = 0
|
||||
|
||||
@ -10,8 +10,6 @@ __copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
|
||||
import copy
|
||||
import struct
|
||||
|
||||
from polyglot.builtins import long_type
|
||||
|
||||
# ======================================================================
|
||||
# Bit-Manipulation helpers
|
||||
#
|
||||
@ -55,10 +53,10 @@ def _bytelist2longBigEndian(blist):
|
||||
j = 0
|
||||
i = 0
|
||||
while i < imax:
|
||||
b0 = long_type(blist[j]) << 24
|
||||
b1 = long_type(blist[j+1]) << 16
|
||||
b2 = long_type(blist[j+2]) << 8
|
||||
b3 = long_type(blist[j+3])
|
||||
b0 = int(blist[j]) << 24
|
||||
b1 = int(blist[j+1]) << 16
|
||||
b2 = int(blist[j+2]) << 8
|
||||
b3 = int(blist[j+3])
|
||||
hl[i] = b0 | b1 | b2 | b3
|
||||
i = i+1
|
||||
j = j+4
|
||||
@ -198,7 +196,7 @@ class mssha1:
|
||||
'''
|
||||
|
||||
inBuf = bytearray(inBuf)
|
||||
leninBuf = long_type(len(inBuf))
|
||||
leninBuf = len(inBuf)
|
||||
|
||||
# Compute number of bytes mod 64.
|
||||
index = (self.count[1] >> 3) & 0x3F
|
||||
|
||||
@ -10,8 +10,6 @@ import re
|
||||
import struct
|
||||
import time
|
||||
|
||||
from polyglot.builtins import long_type
|
||||
|
||||
|
||||
class PdbHeaderReader:
|
||||
|
||||
@ -85,6 +83,6 @@ class PdbHeaderBuilder:
|
||||
|
||||
offset = 78 + (8 * nrecords) + 2
|
||||
for id, record in enumerate(section_lengths):
|
||||
out_stream.write(struct.pack('>LBBBB', long_type(offset), 0, 0, 0, 0))
|
||||
out_stream.write(struct.pack('>LBBBB', int(offset), 0, 0, 0, 0))
|
||||
offset += record
|
||||
out_stream.write(b'\x00\x00')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user