aboutsummaryrefslogtreecommitdiffstats
path: root/templates/ru/s2s.py
diff options
context:
space:
mode:
author <>2003-01-02 05:25:50 +0000
committer <>2003-01-02 05:25:50 +0000
commitb132a73f15e432eaf43310fce9196ca0c0651465 (patch)
treec15f816ba7c4de99fef510e3bd75af0890d47441 /templates/ru/s2s.py
downloadmailman2-b132a73f15e432eaf43310fce9196ca0c0651465.tar.gz
mailman2-b132a73f15e432eaf43310fce9196ca0c0651465.tar.xz
mailman2-b132a73f15e432eaf43310fce9196ca0c0651465.zip
This commit was manufactured by cvs2svn to create branch
'Release_2_1-maint'.
Diffstat (limited to 'templates/ru/s2s.py')
-rwxr-xr-xtemplates/ru/s2s.py66
1 files changed, 66 insertions, 0 deletions
diff --git a/templates/ru/s2s.py b/templates/ru/s2s.py
new file mode 100755
index 00000000..5f3e08bd
--- /dev/null
+++ b/templates/ru/s2s.py
@@ -0,0 +1,66 @@
+#! /usr/bin/python
+
+# A simple script to check the status of the translation.
+
+import sys, string
+from pprint import pprint
+
+def chop (line):
+ if line[-2:] == '\r\n':
+ line = line[:-2]
+
+ if line[-1:] == '\n':
+ line = line[:-1]
+
+ return line
+
+def cmprevision (a, b):
+ '''revisions are something delimited with dots'''
+
+ return cmp (map (lambda x: x.lower (), a.split ('.')), map (lambda x: x.lower (), b.split ('.')))
+
+name = None
+revision = None
+
+files = {}
+
+for line in sys.stdin.readlines ():
+ parts = string.split (chop (line))
+
+ if len (parts) > 0:
+ if parts[0] == 'File:':
+ name = parts[1]
+ elif parts[0] == 'Repository':
+ files[name] = parts[2]
+
+# pprint (files)
+
+action = 0
+
+for line in open ('status', 'r').readlines ():
+ parts = string.split (chop (line))
+
+ if len (parts) > 0:
+ if files.has_key (parts[0]):
+ pass # check the version
+
+ relation = cmprevision (parts[1], files[parts[0]])
+
+ if relation < 0:
+ print 'Update: %s (%s -> %s)' % (parts[0], parts[1], files[parts[0]])
+ action = 1
+ elif relation > 0:
+ print 'Downgrade?: %s (%s -> %s)' % (parts[0], parts[1], files[parts[0]])
+ action = 1
+
+ del files[parts[0]] # delete the item
+ else:
+ print 'Delete:', parts[0]
+ action = 1
+
+for file in files.keys ():
+ print 'New:', file
+ action = 1
+
+if not action:
+ print 'You are translating the latest versions'