[PATCH seda] [migration] Turn line feeds from dos to unix

Sylvain Thenault sylvain.thenault at logilab.fr
Wed Oct 11 15:16:39 CEST 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1507727286 -7200
#      Wed Oct 11 15:08:06 2017 +0200
# Node ID 32150c18b18840d0ba9b494498ffae565b3a818f
# Parent  7f61f6047ca70fd28ff463d4ae6c88b6ada673d5
# Available At https://hg.logilab.org/review/cubes/seda
#              hg pull https://hg.logilab.org/review/cubes/seda -r 32150c18b188
[migration] Turn line feeds from dos to unix

diff --git a/cubicweb_seda/migration/0.11.0_Any.py b/cubicweb_seda/migration/0.11.0_Any.py
--- a/cubicweb_seda/migration/0.11.0_Any.py
+++ b/cubicweb_seda/migration/0.11.0_Any.py
@@ -1,45 +1,46 @@
-from __future__ import print_function
-
-print('filtering language concepts, this will take a while')
-
-seda_02_langs = set((
-    'aa', 'ab', 'af', 'ak', 'am', 'ar', 'an', 'as', 'av', 'ae', 'ay', 'az',
-    'ba', 'bm', 'be', 'bn', 'bh', 'bi', 'bo', 'bs', 'br', 'bg',
-    'ca', 'cs', 'ch', 'ce', 'cu', 'cv', 'co', 'cr', 'cy',
-    'da', 'de', 'dv', 'dz',
-    'el', 'en', 'eo', 'et', 'ee', 'es', 'eu',
-    'fo', 'fa', 'fj', 'fi', 'fr', 'fy', 'ff',
-    'ga', 'gl', 'gv', 'gn', 'gu',
-    'ht', 'ha', 'he', 'hz', 'hi', 'ho', 'hr', 'hu', 'hy',
-    'ig', 'is', 'io', 'ii', 'iu', 'ie', 'ia', 'id', 'ik', 'it',
-    'jv', 'ja',
-    'ka', 'kl', 'kn', 'ks', 'kr', 'kk', 'km', 'ki', 'ky', 'kv', 'kg', 'ko', 'kj', 'ku', 'kw',
-    'lo', 'lv', 'li', 'ln', 'lt', 'lb', 'lu', 'lg',
-    'mk', 'mh', 'ml', 'mi', 'mr', 'ms', 'mg', 'mt', 'mn', 'my',
-    'na', 'nv', 'nr', 'nd', 'ng', 'ne', 'nn', 'nb', 'no', 'ny', 'nl',
-    'oc', 'oj', 'or', 'om', 'os',
-    'pa', 'pi', 'pl', 'pt', 'ps'
-    'qu',
-    'rm', 'ro', 'rn', 'ru', 'rw',
-    'sg', 'sa', 'si', 'sk', 'sl', 'se', 'sm', 'sn', 'sd', 'so', 'st', 'sc', 'sr', 'ss', 'su', 'sw', 'sv', 'sq',
-    'ty', 'ta', 'tt', 'te', 'tg', 'tl', 'th', 'ti', 'to', 'tn', 'ts', 'tk', 'tr', 'tw',
-    'ug', 'uk', 'ur', 'uz',
-    've', 'vi', 'vo',
-    'wa', 'wo',
-    'xh',
-    'yi', 'yo',
-    'za', 'zu', 'zh',
-))
-
-rset = rql(
-    'Any X WHERE X in_scheme S, S title "Langues (ISO-639-3)", '
-    'L label_of X, L language_code "seda-02", NOT L label IN ({})'
-    .format(','.join(repr(code) for code in seda_02_langs)))
-print(len(rset), 'concepts to delete')
-for i, concept in enumerate(rset.entities()):
-    concept.cw_delete()
-    if i % 10:
-        cnx.commit()
-
-
-sync_schema_props_perms('user_cardinality')
+from __future__ import print_function
+
+print('filtering language concepts, this will take a while')
+
+seda_02_langs = set((
+    'aa', 'ab', 'af', 'ak', 'am', 'ar', 'an', 'as', 'av', 'ae', 'ay', 'az',
+    'ba', 'bm', 'be', 'bn', 'bh', 'bi', 'bo', 'bs', 'br', 'bg',
+    'ca', 'cs', 'ch', 'ce', 'cu', 'cv', 'co', 'cr', 'cy',
+    'da', 'de', 'dv', 'dz',
+    'el', 'en', 'eo', 'et', 'ee', 'es', 'eu',
+    'fo', 'fa', 'fj', 'fi', 'fr', 'fy', 'ff',
+    'ga', 'gl', 'gv', 'gn', 'gu',
+    'ht', 'ha', 'he', 'hz', 'hi', 'ho', 'hr', 'hu', 'hy',
+    'ig', 'is', 'io', 'ii', 'iu', 'ie', 'ia', 'id', 'ik', 'it',
+    'jv', 'ja',
+    'ka', 'kl', 'kn', 'ks', 'kr', 'kk', 'km', 'ki', 'ky', 'kv', 'kg', 'ko', 'kj', 'ku', 'kw',
+    'lo', 'lv', 'li', 'ln', 'lt', 'lb', 'lu', 'lg',
+    'mk', 'mh', 'ml', 'mi', 'mr', 'ms', 'mg', 'mt', 'mn', 'my',
+    'na', 'nv', 'nr', 'nd', 'ng', 'ne', 'nn', 'nb', 'no', 'ny', 'nl',
+    'oc', 'oj', 'or', 'om', 'os',
+    'pa', 'pi', 'pl', 'pt', 'ps'
+    'qu',
+    'rm', 'ro', 'rn', 'ru', 'rw',
+    'sg', 'sa', 'si', 'sk', 'sl', 'se', 'sm', 'sn', 'sd', 'so', 'st', 'sc', 'sr', 'ss', 'su', 'sw', 'sv', 'sq',
+    'ty', 'ta', 'tt', 'te', 'tg', 'tl', 'th', 'ti', 'to', 'tn', 'ts', 'tk', 'tr', 'tw',
+    'ug', 'uk', 'ur', 'uz',
+    've', 'vi', 'vo',
+    'wa', 'wo',
+    'xh',
+    'yi', 'yo',
+    'za', 'zu', 'zh',
+))
+
+rset = rql(
+    'Any X WHERE X in_scheme S, S title "Langues (ISO-639-3)", '
+    'L label_of X, L language_code "seda-02", NOT L label IN ({})'
+    .format(','.join(repr(code) for code in seda_02_langs)))
+print(len(rset), 'concepts to delete')
+for i, concept in enumerate(rset.entities()):
+    concept.cw_delete()
+    if i % 10:
+        cnx.commit()
+
+
+sync_schema_props_perms('user_cardinality')
+


More information about the saem-devel mailing list