forcing everything python3, might end up with bugs

This commit is contained in:
Ville Rantanen
2021-04-09 13:01:04 +03:00
parent 72310083f6
commit 525c93a106
23 changed files with 276 additions and 243 deletions

View File

@@ -1,10 +1,11 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# coding=UTF-8
from __future__ import print_function
import sys
import os,time,datetime
import sqlite3
import subprocess,shlex
from argparse import ArgumentParser
from argparse import ArgumentParser
SQLFILE=os.path.expandvars('$HOME/.rsync-queue.sqlite')
@@ -55,7 +56,7 @@ def createdb(fname):
conn.text_factory=str
db.execute('CREATE TABLE list (id INTEGER PRIMARY KEY AUTOINCREMENT,\
SRC TEXT,TGT TEXT, exitcode INTEGER)')
conn.commit()
conn.commit()
return
def mark_done(options, SRC,TGT, exitcode):
@@ -105,9 +106,9 @@ def list_URLs(options):
db.execute("SELECT * FROM list ORDER BY id")
else:
db.execute("SELECT * FROM list WHERE exitcode > 0 ORDER BY id")
print "EC\tSRC\tTGT"
print("EC\tSRC\tTGT")
for row in db:
print "%s\t%s\t%s" % (row[3],row[1],row[2])
print("%s\t%s\t%s" % (row[3],row[1],row[2]))
return
def start_sync(options):
@@ -121,7 +122,7 @@ def start_sync(options):
command=['rsync']
command.extend(syncopts)
command.extend([SRC,TGT])
popen = subprocess.Popen(command,
popen = subprocess.Popen(command,
stdout=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=8)
j=1
try: