mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 16:02:33 +03:00
Switch to io.StringIO
This commit is contained in:
parent
e3591cb7b8
commit
ca5ee87b16
2 changed files with 5 additions and 12 deletions
|
@ -23,11 +23,7 @@ import re
|
||||||
import glob
|
import glob
|
||||||
import cgi
|
import cgi
|
||||||
import textwrap
|
import textwrap
|
||||||
|
import io
|
||||||
try:
|
|
||||||
from cStringIO import StringIO
|
|
||||||
except:
|
|
||||||
from StringIO import StringIO
|
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
# use libyaml if it is available
|
# use libyaml if it is available
|
||||||
|
@ -513,8 +509,8 @@ class DescriptionFormatter:
|
||||||
self.laststate = self.stNONE
|
self.laststate = self.stNONE
|
||||||
self.text_html = ''
|
self.text_html = ''
|
||||||
self.text_txt = ''
|
self.text_txt = ''
|
||||||
self.html = StringIO()
|
self.html = io.StringIO()
|
||||||
self.text = StringIO()
|
self.text = io.StringIO()
|
||||||
self.para_lines = []
|
self.para_lines = []
|
||||||
self.linkResolver = None
|
self.linkResolver = None
|
||||||
self.linkResolver = linkres
|
self.linkResolver = linkres
|
||||||
|
|
|
@ -20,10 +20,7 @@
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
try:
|
import io
|
||||||
from cStringIO import StringIO
|
|
||||||
except:
|
|
||||||
from StringIO import StringIO
|
|
||||||
|
|
||||||
import common
|
import common
|
||||||
import metadata
|
import metadata
|
||||||
|
@ -33,7 +30,7 @@ options = None
|
||||||
|
|
||||||
|
|
||||||
def proper_format(app):
|
def proper_format(app):
|
||||||
s = StringIO()
|
s = io.StringIO()
|
||||||
# TODO: currently reading entire file again, should reuse first
|
# TODO: currently reading entire file again, should reuse first
|
||||||
# read in metadata.py
|
# read in metadata.py
|
||||||
with open(app.metadatapath, 'r') as f:
|
with open(app.metadatapath, 'r') as f:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue