4
4
Authors: A. Pasotti, V. Picavet
5
5
git sha : $TemplateVCSFormat
6
6
"""
7
+ from __future__ import print_function
7
8
9
+ from future import standard_library
10
+ standard_library .install_aliases ()
11
+ from builtins import input
8
12
import sys
9
13
import getpass
10
- import xmlrpclib
14
+ import xmlrpc . client
11
15
from optparse import OptionParser
12
16
13
17
# Configuration
@@ -31,25 +35,36 @@ def main(parameters, arguments):
31
35
parameters .server ,
32
36
parameters .port ,
33
37
ENDPOINT )
34
- print "Connecting to: %s" % hide_password (address )
38
+ # fix_print_with_import
39
+ print ("Connecting to: %s" % hide_password (address ))
35
40
36
- server = xmlrpclib .ServerProxy (address , verbose = VERBOSE )
41
+ server = xmlrpc . client .ServerProxy (address , verbose = VERBOSE )
37
42
38
43
try :
39
44
plugin_id , version_id = server .plugin .upload (
40
- xmlrpclib .Binary (open (arguments [0 ]).read ()))
41
- print "Plugin ID: %s" % plugin_id
42
- print "Version ID: %s" % version_id
43
- except xmlrpclib .ProtocolError , err :
44
- print "A protocol error occurred"
45
- print "URL: %s" % hide_password (err .url , 0 )
46
- print "HTTP/HTTPS headers: %s" % err .headers
47
- print "Error code: %d" % err .errcode
48
- print "Error message: %s" % err .errmsg
49
- except xmlrpclib .Fault , err :
50
- print "A fault occurred"
51
- print "Fault code: %d" % err .faultCode
52
- print "Fault string: %s" % err .faultString
45
+ xmlrpc .client .Binary (open (arguments [0 ]).read ()))
46
+ # fix_print_with_import
47
+ print ("Plugin ID: %s" % plugin_id )
48
+ # fix_print_with_import
49
+ print ("Version ID: %s" % version_id )
50
+ except xmlrpc .client .ProtocolError as err :
51
+ # fix_print_with_import
52
+ print ("A protocol error occurred" )
53
+ # fix_print_with_import
54
+ print ("URL: %s" % hide_password (err .url , 0 ))
55
+ # fix_print_with_import
56
+ print ("HTTP/HTTPS headers: %s" % err .headers )
57
+ # fix_print_with_import
58
+ print ("Error code: %d" % err .errcode )
59
+ # fix_print_with_import
60
+ print ("Error message: %s" % err .errmsg )
61
+ except xmlrpc .client .Fault as err :
62
+ # fix_print_with_import
63
+ print ("A fault occurred" )
64
+ # fix_print_with_import
65
+ print ("Fault code: %d" % err .faultCode )
66
+ # fix_print_with_import
67
+ print ("Fault string: %s" % err .faultString )
53
68
54
69
55
70
def hide_password (url , start = 6 ):
@@ -85,7 +100,8 @@ def hide_password(url, start=6):
85
100
help = "Specify server name" , metavar = "plugins.qgis.org" )
86
101
options , args = parser .parse_args ()
87
102
if len (args ) != 1 :
88
- print "Please specify zip file.\n "
103
+ # fix_print_with_import
104
+ print ("Please specify zip file.\n " )
89
105
parser .print_help ()
90
106
sys .exit (1 )
91
107
if not options .server :
@@ -95,8 +111,9 @@ def hide_password(url, start=6):
95
111
if not options .username :
96
112
# interactive mode
97
113
username = getpass .getuser ()
98
- print "Please enter user name [%s] :" % username ,
99
- res = raw_input ()
114
+ # fix_print_with_import
115
+ print ("Please enter user name [%s] :" % username , end = ' ' )
116
+ res = input ()
100
117
if res != "" :
101
118
options .username = res
102
119
else :
0 commit comments