57 lines
1.6 KiB
Diff
57 lines
1.6 KiB
Diff
diff --git a/magic/Magdir/python b/magic/Magdir/python
|
|
index d954ee6..52796ba 100644
|
|
--- a/magic/Magdir/python
|
|
+++ b/magic/Magdir/python
|
|
@@ -1,6 +1,6 @@
|
|
|
|
#------------------------------------------------------------------------------
|
|
-# $File: python,v 1.25 2014/05/06 16:08:32 christos Exp $
|
|
+# $File: python,v 1.22 2013/03/18 12:49:55 christos Exp $
|
|
# python: file(1) magic for python
|
|
#
|
|
# Outlook puts """ too for urgent messages
|
|
@@ -37,20 +37,24 @@
|
|
# from module.submodule import func1, func2
|
|
0 regex \^from\\s+(\\w|\\.)+\\s+import.*$ Python script text executable
|
|
!:mime text/x-python
|
|
+!:strength + 15
|
|
|
|
# def __init__ (self, ...):
|
|
0 search/4096 def\ __init__
|
|
>&0 search/64 self Python script text executable
|
|
!:mime text/x-python
|
|
+!:strength + 15
|
|
|
|
# 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
|
|
+!:strength + 15
|
|
|
|
-#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
|
|
+!:strength + 15
|
|
|
|
# try:
|
|
# except: or finally:
|
|
@@ -60,8 +64,10 @@
|
|
!:mime text/x-python
|
|
>&0 search/4096 finally: Python script text executable
|
|
!:mime text/x-python
|
|
+!:strength + 15
|
|
|
|
# def name(args, args):
|
|
-0 regex \^(\ |\\t){0,50}def\ {1,50}[a-zA-Z]{1,100}
|
|
->&0 regex \ {0,50}\\(([a-zA-Z]|,|\ ){1,255}\\):$ Python script text executable
|
|
+0 regex \^(\ |\\t)*def\ +[a-zA-Z]+
|
|
+>&0 regex \ *\\(([a-zA-Z]|,|\ )*\\):$ Python script text executable
|
|
!:mime text/x-python
|
|
+!:strength + 15
|