X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dce2bd223c2370f001f9ca93e04cbd437ff3f988..90fb367e86c1e82367f8d4781b8c1bdc31a26593:/wxPython/src/_config.i diff --git a/wxPython/src/_config.i b/wxPython/src/_config.i index ec06be39c7..1c8b100ff3 100644 --- a/wxPython/src/_config.i +++ b/wxPython/src/_config.i @@ -24,12 +24,14 @@ %{ static PyObject* __EnumerationHelper(bool flag, wxString& str, long index) { + wxPyBlock_t blocked = wxPyBeginBlockThreads(); PyObject* ret = PyTuple_New(3); if (ret) { PyTuple_SET_ITEM(ret, 0, PyInt_FromLong(flag)); PyTuple_SET_ITEM(ret, 1, wx2PyString(str)); PyTuple_SET_ITEM(ret, 2, PyInt_FromLong(index)); } + wxPyEndBlockThreads(blocked); return ret; } %} @@ -47,24 +49,23 @@ enum DocStr(wxConfigBase, "wx.ConfigBase class defines the basic interface of all config -classes. It can not be used by itself (it is an abstract base -class) and you will always use one of its derivations: wx.Config -or wx.FileConfig. - -wx.ConfigBase organizes the items in a tree-like structure, -modeled after the Unix/Dos filesystem. There are groups that act -like directories and entries, key/value pairs that act like -files. There is always one current group given by the current -path. As in the file system case, to specify a key in the config -class you must use a path to it. Config classes also support the -notion of the current group, which makes it possible to use -relative paths. +classes. It can not be used by itself (it is an abstract base class) +and you will always use one of its derivations: wx.Config or +wx.FileConfig. + +wx.ConfigBase organizes the items in a tree-like structure, modeled +after the Unix/Dos filesystem. There are groups that act like +directories and entries, key/value pairs that act like files. There +is always one current group given by the current path. As in the file +system case, to specify a key in the config class you must use a path +to it. Config classes also support the notion of the current group, +which makes it possible to use relative paths. Keys are pairs \"key_name = value\" where value may be of string, integer floating point or boolean, you can not store binary data -without first encoding it as a string. For performance reasons -items should be kept small, no more than a couple kilobytes. -"); +without first encoding it as a string. For performance reasons items +should be kept small, no more than a couple kilobytes. +", ""); class wxConfigBase { @@ -86,52 +87,54 @@ public: }; + %disownarg( wxConfigBase *config ); DocDeclStr( static wxConfigBase *, Set(wxConfigBase *config), - "Sets the global config object (the one returned by Get) and\n" - "returns a reference to the previous global config object."); - + "Sets the global config object (the one returned by Get) and returns a +reference to the previous global config object.", ""); + %cleardisown( wxConfigBase *config ); DocDeclStr( - static wxConfigBase *, Get(bool createOnDemand = True), - "Returns the current global config object, creating one if neccessary."); + static wxConfigBase *, Get(bool createOnDemand = true), + "Returns the current global config object, creating one if neccessary.", ""); DocDeclStr( static wxConfigBase *, Create(), - "Create and return a new global config object. This function will\n" - "create the \"best\" implementation of wx.Config available for the\n" - "current platform."); + "Create and return a new global config object. This function will +create the \"best\" implementation of wx.Config available for the +current platform.", ""); DocDeclStr( static void , DontCreateOnDemand(), - "Should Get() try to create a new log object if there isn't a current one?"); + "Should Get() try to create a new log object if there isn't a current +one?", ""); DocDeclStr( virtual void , SetPath(const wxString& path), - "Set current path: if the first character is '/', it's the absolute path,\n" - "otherwise it's a relative path. '..' is supported. If the strPath\n" - "doesn't exist it is created."); + "Set current path: if the first character is '/', it's the absolute +path, otherwise it's a relative path. '..' is supported. If the +strPath doesn't exist it is created.", ""); DocDeclStr( virtual const wxString& , GetPath() const, - "Retrieve the current path (always as absolute path)"); + "Retrieve the current path (always as absolute path)", ""); %extend { DocAStr(GetFirstGroup, "GetFirstGroup() -> (more, value, index)", - "Allows enumerating the subgroups in a config object. Returns\n" - "a tuple containing a flag indicating there are more items, the\n" - "name of the current item, and an index to pass to GetNextGroup to\n" - "fetch the next item."); + "Allows enumerating the subgroups in a config object. Returns a tuple +containing a flag indicating there are more items, the name of the +current item, and an index to pass to GetNextGroup to fetch the next +item.", ""); PyObject* GetFirstGroup() { bool cont; long index = 0; @@ -145,10 +148,10 @@ public: DocAStr(GetNextGroup, "GetNextGroup(long index) -> (more, value, index)", - "Allows enumerating the subgroups in a config object. Returns\n" - "a tuple containing a flag indicating there are more items, the\n" - "name of the current item, and an index to pass to GetNextGroup to\n" - "fetch the next item."); + "Allows enumerating the subgroups in a config object. Returns a tuple +containing a flag indicating there are more items, the name of the +current item, and an index to pass to GetNextGroup to fetch the next +item.", ""); PyObject* GetNextGroup(long index) { bool cont; wxString value; @@ -160,10 +163,10 @@ public: DocAStr(GetFirstEntry, "GetFirstEntry() -> (more, value, index)", - "Allows enumerating the entries in the current group in a config\n" - "object. Returns a tuple containing a flag indicating there are\n" - "more items, the name of the current item, and an index to pass to\n" - "GetNextGroup to fetch the next item."); + "Allows enumerating the entries in the current group in a config +object. Returns a tuple containing a flag indicating there are more +items, the name of the current item, and an index to pass to +GetNextGroup to fetch the next item.", ""); PyObject* GetFirstEntry() { bool cont; long index = 0; @@ -176,10 +179,10 @@ public: DocAStr(GetNextEntry, "GetNextEntry(long index) -> (more, value, index)", - "Allows enumerating the entries in the current group in a config\n" - "object. Returns a tuple containing a flag indicating there are\n" - "more items, the name of the current item, and an index to pass to\n" - "GetNextGroup to fetch the next item."); + "Allows enumerating the entries in the current group in a config +object. Returns a tuple containing a flag indicating there are more +items, the name of the current item, and an index to pass to +GetNextGroup to fetch the next item.", ""); PyObject* GetNextEntry(long index) { bool cont; wxString value; @@ -192,47 +195,47 @@ public: DocDeclStr( - virtual size_t , GetNumberOfEntries(bool recursive = False) const, - "Get the number of entries in the current group, with or\n" - "without its subgroups."); + virtual size_t , GetNumberOfEntries(bool recursive = false) const, + "Get the number of entries in the current group, with or without its +subgroups.", ""); DocDeclStr( - virtual size_t , GetNumberOfGroups(bool recursive = False) const, - "Get the number of subgroups in the current group, with or\n" - "without its subgroups."); + virtual size_t , GetNumberOfGroups(bool recursive = false) const, + "Get the number of subgroups in the current group, with or without its +subgroups.", ""); DocDeclStr( virtual bool , HasGroup(const wxString& name) const, - "Returns True if the group by this name exists"); + "Returns True if the group by this name exists", ""); DocDeclStr( virtual bool , HasEntry(const wxString& name) const, - "Returns True if the entry by this name exists"); + "Returns True if the entry by this name exists", ""); DocDeclStr( bool , Exists(const wxString& name) const, - "Returns True if either a group or an entry with a given name exists"); + "Returns True if either a group or an entry with a given name exists", ""); // get the entry type DocDeclStr( virtual EntryType , GetEntryType(const wxString& name) const, - "Get the type of the entry. Returns one of the wx.Config.Type_XXX values."); + "Get the type of the entry. Returns one of the wx.Config.Type_XXX values.", ""); DocDeclStr( wxString , Read(const wxString& key, const wxString& defaultVal = wxPyEmptyString), - "Returns the value of key if it exists, defaultVal otherwise."); + "Returns the value of key if it exists, defaultVal otherwise.", ""); %extend { DocStr(ReadInt, - "Returns the value of key if it exists, defaultVal otherwise."); + "Returns the value of key if it exists, defaultVal otherwise.", ""); long ReadInt(const wxString& key, long defaultVal = 0) { long rv; self->Read(key, &rv, defaultVal); @@ -240,7 +243,7 @@ public: } DocStr(ReadFloat, - "Returns the value of key if it exists, defaultVal otherwise."); + "Returns the value of key if it exists, defaultVal otherwise.", ""); double ReadFloat(const wxString& key, double defaultVal = 0.0) { double rv; self->Read(key, &rv, defaultVal); @@ -248,8 +251,8 @@ public: } DocStr(ReadBool, - "Returns the value of key if it exists, defaultVal otherwise."); - bool ReadBool(const wxString& key, bool defaultVal = False) { + "Returns the value of key if it exists, defaultVal otherwise.", ""); + bool ReadBool(const wxString& key, bool defaultVal = false) { bool rv; self->Read(key, &rv, defaultVal); return rv; @@ -260,112 +263,113 @@ public: // write the value (return True on success) DocDeclStr( bool , Write(const wxString& key, const wxString& value), - "write the value (return True on success)"); + "write the value (return True on success)", ""); DocDeclStrName( bool, Write(const wxString& key, long value), - "write the value (return True on success)", + "write the value (return True on success)", "", WriteInt); DocDeclStrName( bool, Write(const wxString& key, double value), - "write the value (return True on success)", + "write the value (return True on success)", "", WriteFloat); DocDeclStrName( bool, Write(const wxString& key, bool value), - "write the value (return True on success)", + "write the value (return True on success)", "", WriteBool); DocDeclStr( - virtual bool , Flush(bool currentOnly = False), - "permanently writes all changes"); + virtual bool , Flush(bool currentOnly = false), + "permanently writes all changes", ""); DocDeclStr( virtual bool , RenameEntry(const wxString& oldName, const wxString& newName), - "Rename an entry. Returns False on failure (probably because the new\n" - "name is already taken by an existing entry)"); + "Rename an entry. Returns False on failure (probably because the new +name is already taken by an existing entry)", ""); DocDeclStr( virtual bool , RenameGroup(const wxString& oldName, const wxString& newName), - "Rename aa group. Returns False on failure (probably because the new\n" - "name is already taken by an existing entry)"); + "Rename a group. Returns False on failure (probably because the new +name is already taken by an existing entry)", ""); // deletes the specified entry and the group it belongs to if // it was the last key in it and the second parameter is True DocDeclStr( virtual bool , DeleteEntry(const wxString& key, - bool deleteGroupIfEmpty = True), - "Deletes the specified entry and the group it belongs to if\n" - "it was the last key in it and the second parameter is True"); + bool deleteGroupIfEmpty = true), + "Deletes the specified entry and the group it belongs to if it was the +last key in it and the second parameter is True", ""); DocDeclStr( virtual bool , DeleteGroup(const wxString& key), - "Delete the group (with all subgroups)"); + "Delete the group (with all subgroups)", ""); DocDeclStr( virtual bool , DeleteAll(), - "Delete the whole underlying object (disk file, registry key, ...)\n" - "primarly intended for use by deinstallation routine."); + "Delete the whole underlying object (disk file, registry key, ...) +primarly intended for use by deinstallation routine.", ""); DocDeclStr( - void , SetExpandEnvVars(bool doIt = True), - "We can automatically expand environment variables in the config entries\n" - "(this option is on by default, you can turn it on/off at any time)"); + void , SetExpandEnvVars(bool doIt = true), + "We can automatically expand environment variables in the config +entries this option is on by default, you can turn it on/off at any +time)", ""); DocDeclStr( bool , IsExpandingEnvVars() const, - "Are we currently expanding environment variables?"); + "Are we currently expanding environment variables?", ""); DocDeclStr( - void , SetRecordDefaults(bool doIt = True), - "Set whether the config objec should record default values."); + void , SetRecordDefaults(bool doIt = true), + "Set whether the config objec should record default values.", ""); DocDeclStr( bool , IsRecordingDefaults() const, - "Are we currently recording default values?"); + "Are we currently recording default values?", ""); DocDeclStr( wxString , ExpandEnvVars(const wxString& str) const, - "Expand any environment variables in str and return the result"); + "Expand any environment variables in str and return the result", ""); DocDeclStr( wxString , GetAppName() const, - ""); + "", ""); DocDeclStr( wxString , GetVendorName() const, - ""); + "", ""); DocDeclStr( void , SetAppName(const wxString& appName), - ""); + "", ""); DocDeclStr( void , SetVendorName(const wxString& vendorName), - ""); + "", ""); DocDeclStr( void , SetStyle(long style), - ""); + "", ""); DocDeclStr( long , GetStyle() const, - ""); + "", ""); }; @@ -374,7 +378,7 @@ public: DocStr(wxConfig, "This ConfigBase-derived class will use the registry on Windows, -and will be a wx.FileConfig on other platforms."); +and will be a wx.FileConfig on other platforms.", ""); class wxConfig : public wxConfigBase { public: @@ -384,7 +388,7 @@ public: const wxString& localFilename = wxPyEmptyString, const wxString& globalFilename = wxPyEmptyString, long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE), - ""); + "", ""); ~wxConfig(); }; @@ -393,7 +397,7 @@ public: DocStr(wxFileConfig, - "This config class will use a file for storage on all platforms."); + "This config class will use a file for storage on all platforms.", ""); class wxFileConfig : public wxConfigBase { public: @@ -403,7 +407,7 @@ public: const wxString& localFilename = wxPyEmptyString, const wxString& globalFilename = wxPyEmptyString, long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE), - ""); + "", ""); ~wxFileConfig(); }; @@ -412,23 +416,23 @@ public: //--------------------------------------------------------------------------- DocStr(wxConfigPathChanger, -"A handy little class which changes current path to the path of -given entry and restores it in the destructoir: so if you declare -a local variable of this type, you work in the entry directory -and the path is automatically restored when the function returns."); +"A handy little class which changes current path to the path of given +entry and restores it in the destructoir: so if you declare a local +variable of this type, you work in the entry directory and the path is +automatically restored when the function returns.", ""); class wxConfigPathChanger { public: DocCtorStr( wxConfigPathChanger(const wxConfigBase *config, const wxString& entry), - ""); + "", ""); ~wxConfigPathChanger(); DocDeclStr( const wxString& , Name() const, - "Get the key name"); + "Get the key name", ""); }; @@ -438,10 +442,10 @@ public: DocDeclStr( wxString , wxExpandEnvVars(const wxString &sz), - "Replace environment variables ($SOMETHING) with their values. The\n" - "format is $VARNAME or ${VARNAME} where VARNAME contains\n" - "alphanumeric characters and '_' only. '$' must be escaped ('\$')\n" - "in order to be taken literally."); + "Replace environment variables ($SOMETHING) with their values. The +format is $VARNAME or ${VARNAME} where VARNAME contains alphanumeric +characters and '_' only. '$' must be escaped ('\$') in order to be +taken literally.", "");