Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Paste
P426
Command-Line Input
Active
Public
Actions
Authored by
swills
on Sep 19 2020, 2:18 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F9002279: Command-Line Input
Sep 19 2020, 2:18 PM
2020-09-19 14:18:28 (UTC+0)
Subscribers
None
--- src/3rdparty/chromium/tools/polymer/polymer.py.orig 2020-05-06 14:21:29 UTC
+++ src/3rdparty/chromium/tools/polymer/polymer.py
@@ -491,8 +491,6 @@ def main(argv):
# across platforms.
with io.open(os.path.join(out_folder, result[1]), mode='w', encoding='utf-8', newline='\n') as f:
for l in result[0]:
- if (type(l) != unicode):
- l = unicode(l, encoding='utf-8')
f.write(l)
return
--- src/3rdparty/chromium/mojo/public/tools/bindings/pylib/mojom/generate/generator.py.orig 2020-09-18 15:56:57.902602000 -0400
+++ src/3rdparty/chromium/mojo/public/tools/bindings/pylib/mojom/generate/generator.py 2020-09-18 16:13:16.982174000 -0400
@@ -112,7 +112,10 @@
# Dump the data to disk.
with open(full_path, "wb") as f:
- f.write(contents)
+ if isinstance(contents, str):
+ f.write(contents.encode('utf-8'))
+ else:
+ f.write(contents)
def AddComputedData(module):
--- src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_cpp_generator.py.orig 2020-05-06 10:21:29.000000000 -0400
+++ src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_cpp_generator.py 2020-09-19 09:52:00.906452000 -0400
@@ -208,7 +208,14 @@
class Generator(generator.Generator):
def __init__(self, *args, **kwargs):
+ for x in args:
+ print("I t=" + str(type(x)) + " v=" + str(x))
super(Generator, self).__init__(*args, **kwargs)
+ for x in args:
+ print("I t=" + str(type(x)) + " v=" + str(x))
+ if self.module is not None:
+ print("I structs_t =" + str(type(self.module.structs)))
+ print("I unions_t =" + str(type(self.module.unions)))
def _GetExtraTraitsHeaders(self):
extra_headers = set()
@@ -253,7 +260,7 @@
for field in kind.fields:
AddKind(field.kind)
- for kind in self.module.structs + self.module.unions:
+ for kind in list(self.module.structs) + list(self.module.unions):
for field in kind.fields:
AddKind(field.kind)
@@ -271,9 +278,12 @@
for interface in self.module.interfaces:
all_enums.extend(interface.enums)
+ print("all_enums_t=" + str(type(all_enums)))
+ print("structs_t =" + str(type(self.module.structs)))
+ print("unions_t =" + str(type(self.module.unions)))
types = set(self._GetFullMojomNameForKind(typename)
for typename in
- self.module.structs + all_enums + self.module.unions)
+ list(self.module.structs) + list(all_enums) + list(self.module.unions))
headers = set()
for typename, typemap in self.typemap.items():
if typename in types:
@@ -286,10 +296,10 @@
When false, the generated headers do not need to include interface_ptr.h
and similar.
"""
- if len(self.module.interfaces) > 0:
+ if len(list(self.module.interfaces)) > 0:
return True
return any(map(mojom.ContainsHandlesOrInterfaces,
- self.module.structs + self.module.unions))
+ list(self.module.structs) + list(self.module.unions)))
def _ReferencesAnyNativeType(self):
"""Returns whether this module uses native types directly or indirectly.
@@ -300,7 +310,7 @@
m = self.module
# Note that interfaces can contain scoped native types.
return any(map(mojom.ContainsNativeTypes,
- m.enums + m.structs + m.interfaces))
+ list(m.enums) + list(m.structs) + list(m.interfaces)))
def _GetDirectlyUsedKinds(self):
for struct in self.module.structs + self.module.unions:
@@ -314,9 +324,9 @@
def _GetJinjaExports(self):
all_enums = list(self.module.enums)
- for struct in self.module.structs:
+ for struct in list(self.module.structs):
all_enums.extend(struct.enums)
- for interface in self.module.interfaces:
+ for interface in list(self.module.interfaces):
all_enums.extend(interface.enums)
return {
--- src/3rdparty/chromium/mojo/public/tools/bindings/generators/cpp_templates/module-forward.h.tmpl.orig 2020-09-19 10:09:39.715097000 -0400
+++ src/3rdparty/chromium/mojo/public/tools/bindings/generators/cpp_templates/module-forward.h.tmpl 2020-09-19 10:10:25.010600000 -0400
@@ -43,15 +43,15 @@
#include <stdint.h>
{%- endif %}
-{% if structs|length -%}
+{% if structs|list|length -%}
#include "mojo/public/cpp/bindings/struct_forward.h"
{%- endif %}
-{% if not disallow_interfaces and interfaces|length -%}
+{% if not disallow_interfaces and interfaces|list|length -%}
#include "mojo/public/cpp/bindings/deprecated_interface_types_forward.h"
{%- endif %}
-{% if not disallow_native_types and structs|length %}
+{% if not disallow_native_types and structs|list|length %}
#include "mojo/public/interfaces/bindings/native_struct.mojom-forward.h"
{%- endif %}
--- src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_js_generator.py.orig 2020-09-18 15:47:26.521091000 -0400
+++ src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_js_generator.py 2020-09-19 10:15:43.926201000 -0400
@@ -8,7 +8,7 @@
import mojom.generate.module as mojom
import mojom.generate.pack as pack
import os
-import urllib
+import urllib.request
from mojom.generate.template_expander import UseJinja
_kind_to_javascript_default_value = {
@@ -215,7 +215,7 @@
def GetRelativeUrl(module, base_module):
- return urllib.pathname2url(
+ return urllib.request.pathname2url(
os.path.relpath(module.path, os.path.dirname(base_module.path)))
@@ -260,8 +260,8 @@
"module": self.module,
"mojom_filename": os.path.basename(self.module.path),
"mojom_namespace": self.module.mojom_namespace,
- "structs": self.module.structs + self._GetStructsFromMethods(),
- "unions": self.module.unions,
+ "structs": list(self.module.structs) + list(self._GetStructsFromMethods()),
+ "unions": list(self.module.unions),
"generate_fuzzing": self.generate_fuzzing,
"generate_closure_exports": for_compile,
"generate_struct_deserializers": self.js_generate_struct_deserializers,
Event Timeline
swills
created this paste.
Sep 19 2020, 2:18 PM
2020-09-19 14:18:28 (UTC+0)
Log In to Comment