]> granicus.if.org Git - file/commitdiff
more magic from Jan Kaluza
authorChristos Zoulas <christos@zoulas.com>
Tue, 7 Dec 2010 16:52:52 +0000 (16:52 +0000)
committerChristos Zoulas <christos@zoulas.com>
Tue, 7 Dec 2010 16:52:52 +0000 (16:52 +0000)
magic/Magdir/diff
magic/Magdir/python

index 3eeced086e1e794fbb50ec8d073134775419abba..1c25aca99895c28343148e8ca123fe9f14f604d9 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: diff,v 1.10 2009/09/19 16:28:08 christos Exp $
+# $File: diff,v 1.11 2010/11/25 15:00:12 christos Exp $
 # diff:  file(1) magic for diff(1) output
 #
 0      search/1        diff\           diff output text
 
 # bsdiff:  file(1) magic for bsdiff(1) output
 0      string/t                BSDIFF40        bsdiff(1) patch file
+
+
+# unified diff
+0      search/4096     ---\ 
+>&0    search/1024 \n
+>>&0   search/1 +++\ 
+>>>&0  search/1024 \n
+>>>>&0 search/1 @@     unified diff output text
+!:mime text/x-diff
+!:strength + 90
index 065f875ad381f66caa2427d9850bdd8565b60445..ab0d7a6b69b88b5cbf033faa8f798cdc0b96bda5 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: python,v 1.13 2010/08/12 16:16:44 christos Exp $
+# $File: python,v 1.14 2010/11/25 15:00:12 christos Exp $
 # python:  file(1) magic for python
 #
 # From: David Necas <yeti@physics.muni.cz>
 !:mime text/x-python
 0      search/1        #!\ /usr/bin/env\ ruby  Python script text executable
 !:mime text/x-python
+
+
+# from module.submodule import func1, func2
+0      regex/b \^from\\s+(\\w|\\.)+\\s+import.*$       Python script text executable
+!:mime text/x-python
+
+# def __init__ (self, ...):
+0      search/4096     def\ __init__
+>&0    search/64 self  Python script text executable
+!:mime text/x-python
+
+# comments
+0      search/4096     '''
+>&0    regex   .*'''$  Python script text executable
+!:mime text/x-python
+
+0      search/4096     """
+>&0    regex   .*"""$  Python script text executable
+!:mime text/x-python
+
+# try:
+# except: or finally:
+# block
+0      search/4096     try:
+>&0    regex   \^\\s*except.*: Python script text executable
+!:mime text/x-python
+>&0    search/4096     finally:        Python script text executable
+!:mime text/x-python