Changeset 10674:ac200cc97b30 in orange


Ignore:
Timestamp:
03/28/12 20:31:22 (2 years ago)
Author:
Lan Zagar <lan.zagar@…>
Branch:
default
Message:

Replaced split('\n') with splitlines().

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeWidgets/Data/OWSave.py

    r10462 r10674  
    8181 
    8282#        filename, selectedFilter = QFileDialog.getSaveFileNameAndFilter(self, 'Save Orange Data File', startfile, 
    83 #                        self.dlgFormats, self.dlgFormats.split("\n")[0]) 
     83#                        self.dlgFormats, self.dlgFormats.splitlines()[0]) 
    8484#        filename = str(filename) 
    8585#       The preceding lines should work as per API, but do not; it's probably a PyQt bug as per March 2010. 
     
    8787#       (As a consequence, filter selection is not taken into account when appending a default extension.) 
    8888        filename, selectedFilter = QFileDialog.getSaveFileName(self, 'Save Orange Data File', startfile, 
    89                          self.dlgFormats), self.dlgFormats.split("\n")[0] 
     89                         self.dlgFormats), self.dlgFormats.splitlines()[0] 
    9090        filename = unicode(filename) 
    9191        if not filename or not os.path.split(filename)[1]: 
  • Orange/network/readwrite.py

    r10469 r10674  
    370370    f.close() 
    371371     
    372     content = content.split('\n') 
     372    content = content.splitlines() 
    373373    comments = (line for line in content if line.strip().startswith('#')) 
    374374    content = (line for line in content if not line.strip().startswith('#')) 
  • Orange/orng/addOnPack.py

    r10581 r10674  
    144144            QTextEdit.focusOutEvent(control, ev) 
    145145        for listEdit in [self.e_tags, self.e_aauthors, self.e_acontributors, self.e_aorganizations]: 
    146             listEdit.parseEntries = lambda control=listEdit: [entry for entry in map(lambda x: x.strip(), unicode(control.toPlainText()).split("\n")) if entry] 
     146            listEdit.parseEntries = lambda control=listEdit: [entry for entry in map(lambda x: x.strip(), unicode(control.toPlainText()).splitlines()) if entry] 
    147147            listEdit.focusOutEvent = formatList 
    148148     
  • Orange/orng/updateOrange.py

    r9671 r10674  
    296296            return {}, [], [] 
    297297 
    298         data = f.read().split("\n") 
     298        data = f.read().splitlines() 
    299299        versions = {} 
    300300        updateGroups = []; dontUpdateGroups = [] 
  • install-scripts/orngServer/orngServerFilesServer.py

    r6538 r10674  
    2121    s = open(userfilename, 'rt').read() 
    2222    umap = {} 
    23     for line in s.split('\n'): 
     23    for line in s.splitlines(): 
    2424        try: 
    2525            uname, passw = line.split(',') 
     
    6363        f.close() 
    6464        #print "CONT", cont 
    65         name, protection, datetime, title, tags = cont.split("\n") 
     65        name, protection, datetime, title, tags = cont.splitlines() 
    6666        tags = tags.split(";") 
    6767        self.set(name, protection, datetime, title, tags) 
  • install-scripts/orngServer/serverUpdateScripts/updatemiRNA.py

    r6538 r10674  
    5656     
    5757    for s in sections: 
    58         org = str(re.findall('ID\s*(\S*)\s*standard;',s.split('\n')[0])[0]).split('-')[0] 
     58        org = str(re.findall('ID\s*(\S*)\s*standard;',s.splitlines()[0])[0]).split('-')[0] 
    5959        fastprint(os.path.join(path,'%s_sections.txt' % org),'a',s+'//\n') 
    6060         
     
    111111            my_locs=[] # if it's [61..81] you have to take from 60 to 81. 
    112112             
    113             rows = s.split('\n') 
     113            rows = s.splitlines() 
    114114                 
    115115            for r in rows: 
     
    243243     
    244244    zf = zipfile.ZipFile(StringIO.StringIO(urllib.urlopen(tarscan_url).read())) 
    245     arch = zf.read(zf.namelist()[0]).split('\n')[1:] 
     245    arch = zf.read(zf.namelist()[0]).splitlines()[1:] 
    246246    arch.pop() 
    247247    mirnas = [a.split('\t')[3] for a in arch] 
     
    269269         
    270270if flag: 
    271     orgs_des = dict(zip([re.findall('ID\s*(\S{3,4})-\S*\s*standard;',l)[0] for l in data_webPage.split('\n') if l[0:2]=='ID'],[re.findall('DE\s*(.*)\s\S*.*\sstem[\s|-]loop',l)[0] for l in data_webPage.split('\n') if l[0:2]=='DE'])) 
     271    orgs_des = dict(zip([re.findall('ID\s*(\S{3,4})-\S*\s*standard;',l)[0] for l in data_webPage.splitlines() if l[0:2]=='ID'],[re.findall('DE\s*(.*)\s\S*.*\sstem[\s|-]loop',l)[0] for l in data_webPage.splitlines() if l[0:2]=='DE'])) 
    272272     
    273273    file_org = get_intoFiles(path,data_webPage) 
  • setup.py

    r10507 r10674  
    1515""" 
    1616 
    17 DOCLINES = __doc__.split("\n") 
     17DOCLINES = __doc__.splitlines() 
    1818 
    1919import os, sys         
     
    6060DOWNLOAD_URL        = "https://bitbucket.org/biolab/orange/downloads" 
    6161LICENSE             = 'GNU General Public License (GPL)' 
    62 CLASSIFIERS         = filter(None, CLASSIFIERS.split('\n')) 
     62CLASSIFIERS         = filter(None, CLASSIFIERS.splitlines()) 
    6363AUTHOR              = "Bioinformatics Laboratory, FRI UL" 
    6464AUTHOR_EMAIL        = "orange@fri.uni-lj.si" 
    65 KEYWORDS            = filter(None, KEYWORDS.split('\n')) 
     65KEYWORDS            = filter(None, KEYWORDS.splitlines()) 
    6666MAJOR               = 2 
    6767MINOR               = 5 
Note: See TracChangeset for help on using the changeset viewer.