Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ you can install dpx.confutils using
python setup.py install

Note: the dependency is not specified in the setup.py. You need to install
them yourself. You can use Anaconda or other python enviroment.
them yourself. You can use Anaconda or other python environment.


CONTACTS
Expand Down
16 changes: 8 additions & 8 deletions src/diffpy/srxconfutils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class ConfigBase(object):
"fliphorizontal",
{
"sec": "Beamline",
"h": "filp the image horizontally",
"h": "flip the image horizontally",
"n": "?",
"co": True,
"d": False,
Expand Down Expand Up @@ -542,8 +542,8 @@ def parseArgs(self, pargs):
"""Parse args and update the value in self.*option*, this will
call the self.args() to parse args,

:param pargs: list of string, arguments to parse, usually
comming from sys.argv
:param pargs: list of string, arguments to parse, usually coming
from sys.argv
"""
obj = self.args.parse_args(pargs)
changedargs = obj.__dict__.keys()
Expand Down Expand Up @@ -640,7 +640,7 @@ def _postUpdateConfig(self, **kwargs):

###########################################################################
def _createConfigFile(self):
"""Write output config file if specfied in configuration the
"""Write output config file if specified in configuration the
filename is specified by self.createconfig."""
if (self.createconfig != "") and (self.createconfig != None):
self.writeConfig(self.createconfig, "short")
Expand All @@ -651,7 +651,7 @@ def _createConfigFile(self):
return

def writeConfig(self, filename, mode="short", changeconfigfile=True):
"""Write config to file. the file is compatiable with python
"""Write config to file. the file is compatible with python
package ConfigParser.

:param filename: string, name of file
Expand All @@ -662,7 +662,7 @@ def writeConfig(self, filename, mode="short", changeconfigfile=True):
if changeconfigfile:
self.configfile = os.path.abspath(filename)
self._updateSelf()
# func decide if wirte the option to config according to mode
# func decide if write the option to config according to mode
# options not present in self._optdata will not be written to config
if mode.startswith("s"):
mcond = (
Expand Down Expand Up @@ -706,15 +706,15 @@ def getHeader(self, title=None, mode="full"):
mode, all options with 'a' will be written, in full mode,
all options with 'a' or 'f' will be written
:return: string, lines with line break that can be directly
writen to a text file
written to a text file
"""

lines = []
title = "# %s #" % (
self._defaultdata["headertitle"] if title == None else title
)
lines.append(title)
# func decide if wirte the option to header according to mode
# func decide if write the option to header according to mode
# options not present in self._optdata will not be written to header
if mode.startswith("s"):
mcond = (
Expand Down
4 changes: 2 additions & 2 deletions src/diffpy/srxconfutils/configtraits.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ class ConfigBaseTraits(HasTraits, ConfigBase):
"sec": "Beamline",
"header": "n",
"config": "f",
"l": "Filp horizontally",
"h": "filp the image horizontally",
"l": "Flip horizontally",
"h": "flip the image horizontally",
"n": "?",
"co": True,
"d": False,
Expand Down
6 changes: 3 additions & 3 deletions src/diffpy/srxconfutils/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ def str2bool(v):

def opt2Str(opttype, optvalue):
"""Turn the value of one option to string, according to the option
type list of values are truned into "value1, value2, value3...".
type list of values are turned into "value1, value2, value3...".

:param opttype: string, type of opitons, for example 'str' or
:param opttype: string, type of options, for example 'str' or
'intlist'
:param optvalue: value of the option
:return: string, usually stored in ConfigBase.config
Expand Down Expand Up @@ -111,7 +111,7 @@ def str2Opt(opttype, optvalue):
"""Convert the string to value of one option, according to the
option type.

:param opttype: string, type of opitons, for example 'str' or
:param opttype: string, type of options, for example 'str' or
'intlist'
:param optvalue: string, value of the option
:return: value of the option, usually stored in ConfigBase.config
Expand Down