annotate CADDSuite-1.6/galaxyconfigs/confFiles.py @ 8:dbb480e39d95 draft

Uploaded
author marcel
date Sat, 15 Dec 2012 13:15:46 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
1 # -*- coding: utf-8 -*-
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
2 """
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
3 XML format classes
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
4 """
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
5 import data
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
6 import logging
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
7 from galaxy.datatypes.sniff import *
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
8 import commands
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
9
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
10 log = logging.getLogger(__name__)
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
11
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
12
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
13 class ini( data.Text ):
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
14 file_ext = "ini"
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
15 def sniff( self, filename ):
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
16 self.no_sections = commands.getstatusoutput("grep -c \"\[Docking-Settings\]\" "+filename)
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
17 if (self.no_sections[0] == 0) & (self.no_sections[1] > 0):
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
18 return True
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
19 else:
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
20 self.no_sections = commands.getstatusoutput("grep -c \"\[ReferenceArea\" "+filename)
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
21 if (self.no_sections[0] == 0) & (self.no_sections[1] > 0):
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
22 return True
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
23 else:
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
24 self.no_sections = commands.getstatusoutput("grep -c \"\[PharmacophoreConstraint\" "+filename)
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
25 if (self.no_sections[0] == 0) & (self.no_sections[1] > 0):
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
26 return True
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
27 else:
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
28 return False
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
29
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
30
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
31
dbb480e39d95 Uploaded
marcel
parents:
diff changeset
32