[damned-lies] Use tilde as 'hacky' char in domain name



commit 754e030df0071fb911bf7be6bc0f21d13bc46a25
Author: Claude Paroz <claude 2xlibre net>
Date:   Sat Sep 5 20:07:05 2009 +0200

    Use tilde as 'hacky' char in domain name
    
    To support special gimp-help-2 directory structure, domain name
    can contain a special '~' char to indicate the po/pot files are in
    a subdirectory (previously '_', which could conflict with normal
    file names).

 stats/models.py  |    6 +++---
 urls.py          |    2 +-
 vertimus/urls.py |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/stats/models.py b/stats/models.py
index 31c0ead..26d27ed 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -630,7 +630,7 @@ class Domain(models.Model):
         ordering = ('-dtype', 'name')
 
     def __unicode__(self):
-        return self.get_dtype_display()
+        return "%s (%s)" % (self.name, self.get_dtype_display())
 
     def potbase(self):
         if self.name[:2] == 'po':
@@ -658,7 +658,7 @@ class Domain(models.Model):
                 pofile = os.path.join(dom_path, item)
                 flist.append((lang, pofile))
             elif os.path.isdir(os.path.join(dom_path, item)):
-                for base_name in [item, self.name.replace("_","/")]:
+                for base_name in [item, self.name.replace("~","/")]:
                     pofile = os.path.join(dom_path, item, base_name + ".po")
                     if os.access(pofile, os.F_OK):
                         flist.append((item, pofile))
@@ -688,7 +688,7 @@ class Domain(models.Model):
         potfile = os.path.join(vcs_path, self.potbase() + ".pot")
         if not os.access(potfile, os.R_OK):
             # Try to get POT file from command output, with path relative to checkout root
-            m = re.search('([\w/]*\.pot)', output)
+            m = re.search('([\w/-]*\.pot)', output)
             if m:
                 potfile = os.path.join(current_branch.co_path(), m.group(0))
 
diff --git a/urls.py b/urls.py
index 7f34dfa..4eeeb87 100644
--- a/urls.py
+++ b/urls.py
@@ -70,7 +70,7 @@ urlpatterns += patterns('stats.views',
         regex = r'^module/(?P<module_name>[\w\-\+]+)/branch/(?P<branch_name>[\w-]+)/$',
         view = 'module_branch'),
     url(
-        regex = r'^module/(?P<module_name>[\w\-\+]+)/(?P<potbase>[\w-]+)/(?P<branch_name>[\w-]+)/(?P<langcode>[\w ]+)/images/$',
+        regex = r'^module/(?P<module_name>[\w\-\+]+)/(?P<potbase>[\w~-]+)/(?P<branch_name>[\w-]+)/(?P<langcode>[\w ]+)/images/$',
         view = 'docimages'),
     url(
         regex = r'^releases/(?P<format>(html|json|xml))?/?$',
diff --git a/vertimus/urls.py b/vertimus/urls.py
index 8a60ea8..a461d61 100644
--- a/vertimus/urls.py
+++ b/vertimus/urls.py
@@ -14,11 +14,11 @@ urlpatterns = patterns('vertimus.views',
         view = 'vertimus_diff',
         name = 'vertimus_diff'),
     url(
-        regex = '^(?P<module_name>[\w\+\-\.]+)/(?P<branch_name>[\w\-\.]+)/(?P<domain_name>[\w\-]+)/(?P<locale_name>[\w\- ]+)/level(?P<level>\d+)/$',
+        regex = '^(?P<module_name>[\w\+\-\.]+)/(?P<branch_name>[\w\-\.]+)/(?P<domain_name>[\w~\-]+)/(?P<locale_name>[\w\- ]+)/level(?P<level>\d+)/$',
         view = 'vertimus_by_names',
         name = 'vertimus_archives_by_names'),
     url(
-        regex = r'^(?P<module_name>[\w\+\-\.]+)/(?P<branch_name>[\w\-\.]+)/(?P<domain_name>[\w\-]+)/(?P<locale_name>[\w\- ]+)',
+        regex = r'^(?P<module_name>[\w\+\-\.]+)/(?P<branch_name>[\w\-\.]+)/(?P<domain_name>[\w~\-]+)/(?P<locale_name>[\w\- ]+)',
         view = 'vertimus_by_names',
         name = 'vertimus_by_names'),
 )



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]