use global pattern. the pb is HD I/O not CPU but anyways
This commit is contained in:
		
							parent
							
								
									801f8bd985
								
							
						
					
					
						commit
						50af6160bf
					
				
					 1 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
					@ -33,12 +33,12 @@ cur.executescript(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
con.commit()
 | 
					con.commit()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def from_one_line(msg):
 | 
					# (?<!\\) is a lookbehind assertion which asks anything but '\'
 | 
				
			||||||
	# (?<!\\) is a lookbehind assertion which asks anything but '\'
 | 
					# to match the regexp that follows it
 | 
				
			||||||
	# to match the regexp that follows it
 | 
					re = sre.compile(r'(?<!\\)\\n')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def from_one_line(msg):
 | 
				
			||||||
	# So here match '\\n' but not if you have a '\' before that
 | 
						# So here match '\\n' but not if you have a '\' before that
 | 
				
			||||||
	re = sre.compile(r'(?<!\\)\\n')
 | 
					 | 
				
			||||||
	msg = re.sub('\n', msg)
 | 
						msg = re.sub('\n', msg)
 | 
				
			||||||
	msg = msg.replace('\\\\', '\\')
 | 
						msg = msg.replace('\\\\', '\\')
 | 
				
			||||||
	# s12 = 'test\\ntest\\\\ntest'
 | 
						# s12 = 'test\\ntest\\\\ntest'
 | 
				
			||||||
| 
						 | 
					@ -123,7 +123,7 @@ if __name__ == '__main__':
 | 
				
			||||||
	f.write('We do not use plain-text files anymore, because they do not scale.\n')
 | 
						f.write('We do not use plain-text files anymore, because they do not scale.\n')
 | 
				
			||||||
	f.write('Those files here are logs for Gajim up until 0.8.2\n')
 | 
						f.write('Those files here are logs for Gajim up until 0.8.2\n')
 | 
				
			||||||
	f.write('We now use an sqlite database called logs.db found in ~/.gajim\n')
 | 
						f.write('We now use an sqlite database called logs.db found in ~/.gajim\n')
 | 
				
			||||||
	f.write('You can always run the migration script to import you old logs to the database\n')
 | 
						f.write('You can always run the migration script to import your old logs to the database\n')
 | 
				
			||||||
	f.write('Thank you\n')
 | 
						f.write('Thank you\n')
 | 
				
			||||||
	f.close()
 | 
						f.close()
 | 
				
			||||||
	# after huge import create the indices (they are slow on massive insert)
 | 
						# after huge import create the indices (they are slow on massive insert)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue