[PyQt] pyqtdeploy: data file access on IOS
drembedded at yahoo.com
Wed Feb 25 17:37:42 GMT 2015
Yes I would agree that this seems to be a limitation in sqlite. I had
hoped that there was an alternate connect() method that would take a
file descriptor as an argument as QFile can return its file descriptor,
unfortunately no such luck.
How difficult would it be to "connect" the resource file the python
filesystem as a read-only filesystem? Or perhaps "hook" the open()
command and somehow insert pyqt's resource file system.
On 2/25/15 5:28 AM, lloyd konneker wrote:
> Just talking, to check our understanding ...
> So 'pyqt's resource file system' is not a file system of the OS, and
> must be accessed via Qt functions. Sqllite does not use those Qt
> It seems to me it is a limitation of Sqllite: it only supports file
> systems offered by the OS, and doesn't allow the database data to be
> in say a stream that you can pass to connect(). I am not sure if that
> makes sense, I suppose the data file must offer block access instead
> of just sequential access for it to be of use as a database. Unless
> you are really talking about a small amount of data, or data for which
> you really don't need relational database access.
> On 02/24/2015 06:17 PM, Drembedded wrote:
>> Thank you for your response. Doing this results in the same directory
>> structure: ':/pyqtdeploy_ptest1' that I've hardcoded into the
>> sqlite3.connect() call: essentially the directory within the resource
>> Thats a great way to discover the full path into the resource file if
>> you're using pyqt calls but unfortunately any other methods that use
>> "standard Python file access functions such as sqlite3.connect()
>> don't seem to be able to access the pyqt's resource file system.
>> This limitation is noted in the tutorial:
>> Non-Python (i.e. data) files can also be included in the package. An
>> application typically accesses such files by using
>> theQFileInfo.absolutePath()function on the__file__attribute of a
>> module to obtain the name of the directory containing the data file.
>> This approach will also work with deployed applications so long as
>> the file is accessed using theQFileclass (rather than the standard
>> Python file access functions). However QML files require slightly
>> different treatment as their locations are specified using a URL.
>> So right now my only way around this issue is to copy my sqlite3
>> database file on to the IPad's file system which I can "see" using
>> standrd Pythn file access functions such as
>> pprint.pprint(os.listdir()) which returns:
>> Hopefully someone at Riverbank will chime in here and set me straight.
>> On 2/24/15 5:36 AM, lloyd konneker wrote:
>>> Did you try using __file__ per the documentation here:
>>> http://pyqt.sourceforge.net/Docs/pyqtdeploy/pyrcc.html ??
>>> PyQt mailing list PyQt at riverbankcomputing.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt