Changeset 139048 in webkit


Ignore:
Timestamp:
Jan 8, 2013 2:10:24 AM (11 years ago)
Author:
zandobersek@gmail.com
Message:

[GTK] Make Tools/gtk/generate-gtkdoc compatible with Python 3
https://bugs.webkit.org/show_bug.cgi?id=106195

Reviewed by Philippe Normand.

Perform changes in the generate-gtkdoc script and common and gtkdoc modules
to make the Python code compatible with Python 3. This includes modifying
print statements, exception handling, dictionary iteration and
byte-sequence-to-string conversion.

  • gtk/common.py:

(get_build_path):
(pkg_config_file_variable):
(gtk_version_of_pkg_config_file):

  • gtk/generate-gtkdoc:

(print_missing_api):

  • gtk/gtkdoc.py:

(GTKDoc.init):
(GTKDoc._run_command):

Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r139039 r139048  
     12013-01-08  Zan Dobersek  <zandobersek@gmail.com>
     2
     3        [GTK] Make Tools/gtk/generate-gtkdoc compatible with Python 3
     4        https://bugs.webkit.org/show_bug.cgi?id=106195
     5
     6        Reviewed by Philippe Normand.
     7
     8        Perform changes in the generate-gtkdoc script and common and gtkdoc modules
     9        to make the Python code compatible with Python 3. This includes modifying
     10        print statements, exception handling, dictionary iteration and
     11        byte-sequence-to-string conversion.
     12
     13        * gtk/common.py:
     14        (get_build_path):
     15        (pkg_config_file_variable):
     16        (gtk_version_of_pkg_config_file):
     17        * gtk/generate-gtkdoc:
     18        (print_missing_api):
     19        * gtk/gtkdoc.py:
     20        (GTKDoc.__init__):
     21        (GTKDoc._run_command):
     22
    1232013-01-02  Steve Block  <steveblock@chromium.org>
    224
  • trunk/Tools/gtk/common.py

    r129627 r139048  
    7676        return build_dir
    7777
    78     print 'Could not determine build directory.'
     78    print('Could not determine build directory.')
    7979    sys.exit(1)
    8080
     
    8787    process = subprocess.Popen(['pkg-config', '--variable=%s' % variable, package],
    8888                               stdout=subprocess.PIPE)
    89     stdout = process.communicate()[0]
     89    stdout = process.communicate()[0].decode("utf-8")
    9090    if process.returncode:
    9191        return None
     
    100100    process = subprocess.Popen(['pkg-config', pkg_config_path, '--print-requires'],
    101101                               stdout=subprocess.PIPE)
    102     stdout = process.communicate()[0]
     102    stdout = process.communicate()[0].decode("utf-8")
    103103
    104104    if 'gtk+-3.0' in stdout:
  • trunk/Tools/gtk/generate-gtkdoc

    r138544 r139048  
    144144    if not missing_api:
    145145        return
    146     print "\nThe following API are missing documentation:"
     146    print("\nThe following API are missing documentation:")
    147147    for api in missing_api:
    148         print "\t%s" % api
     148        print("\t%s" % api)
    149149
    150150def generate_doc(generator):
     
    179179    generator = gtkdoc.PkgConfigGTKDoc(pkg_config_path, options)
    180180    if '--rebase' not in sys.argv:
    181         print "Generating WebKit1 documentation..."
     181        print("Generating WebKit1 documentation...")
    182182        saw_webkit1_warnings = generate_doc(generator)
    183183    else:
    184         print "Rebasing WebKit1 documentation..."
     184        print("Rebasing WebKit1 documentation...")
    185185        try:
    186186            generator.rebase_installed_docs()
    187         except Exception,e:
    188             print "Rebase did not happen, likely no documentation is present."
     187        except Exception:
     188            print("Rebase did not happen, likely no documentation is present.")
    189189
    190190# WebKit2 might not be enabled, so check for the pkg-config file before building documentation.
     
    193193    generator = gtkdoc.PkgConfigGTKDoc(pkg_config_path, get_webkit2_options())
    194194    if '--rebase' not in sys.argv:
    195         print "\nGenerating WebKit2 documentation..."
     195        print("\nGenerating WebKit2 documentation...")
    196196        saw_webkit2_warnings = generate_doc(generator)
    197197    else:
    198         print "\nRebasing WebKit2 documentation..."
     198        print("\nRebasing WebKit2 documentation...")
    199199        try:
    200200            generator.rebase_installed_docs()
    201         except Exception,e:
    202             print "Rebase did not happen, likely no documentation is present."
     201        except Exception:
     202            print("Rebase did not happen, likely no documentation is present.")
    203203
    204204sys.exit(saw_webkit1_warnings or saw_webkit2_warnings)
  • trunk/Tools/gtk/gtkdoc.py

    r127475 r139048  
    108108        self.logger = logging.getLogger('gtkdoc')
    109109
    110         for key, value in args.iteritems():
     110        for key, value in iter(args.items()):
    111111            setattr(self, key, value)
    112112
     
    186186                                   stdout=subprocess.PIPE,
    187187                                   stderr=subprocess.PIPE)
    188         stdout, stderr = process.communicate()
     188        stdout, stderr = [b.decode("utf-8") for b in process.communicate()]
    189189
    190190        if print_output:
Note: See TracChangeset for help on using the changeset viewer.