Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/349.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Dropbox:/delta和共享文件夹_Python_Dropbox_Dropbox Api_Delta - Fatal编程技术网

Python Dropbox:/delta和共享文件夹

Python Dropbox:/delta和共享文件夹,python,dropbox,dropbox-api,delta,Python,Dropbox,Dropbox Api,Delta,我正在使用/delta功能查找Dropbox帐户中是否有任何更改 当我第一次运行它时(直到“has_more”变为False),一切都很好。但当我再次运行它时(使用上一次调用中的光标),它会显示一个文件列表。我再次运行它(没有更改任何文件),仍然得到相同的文件列表(尽管它们没有更改)。我想这些文件在一个共享文件夹中。 我再次测试了该文件夹中的一组新文件,得到了相同的结果——这些文件显示在增量条目中,尽管它们没有更改 怎么了 我觉得这是一个错误。有办法避开它吗 编辑: 这是密码 def getDe

我正在使用/delta功能查找Dropbox帐户中是否有任何更改

当我第一次运行它时(直到“has_more”变为False),一切都很好。但当我再次运行它时(使用上一次调用中的光标),它会显示一个文件列表。我再次运行它(没有更改任何文件),仍然得到相同的文件列表(尽管它们没有更改)。我想这些文件在一个共享文件夹中。 我再次测试了该文件夹中的一组新文件,得到了相同的结果——这些文件显示在增量条目中,尽管它们没有更改

怎么了

我觉得这是一个错误。有办法避开它吗

编辑: 这是密码

def getDeltaEntries(self): #this function is a method of a class
    def _getDelta():
        delta = self.client.delta(self.cursor)
        entries = delta.get('entries')
        has_more = delta.get('has_more')
        self.cursor = delta['cursor']

        while has_more:
            delt = self.client.delta(self.cursor)
            entries.extend(delta.get('entries'))
            has_more = delt.get('has_more')
            self.cursor = delta['cursor']
        return entries
    #workaround: query for delta twice and if the result is the same both times, 
    #it implies there's no change

    ent1 = _getDelta()
    ent2 = _getDelta()
    if ent1 == ent2:
        entries = []
    else:
        entries = ent1
    return entries

您的代码似乎正在使用
self.cursor=delta['cursor']
当它应该使用
self.cursor=delt['cursor']
时,您可以添加代码吗?我们确实需要查看代码以获得帮助。一般来说,我从未见过您描述的行为。您是否在每次调用时都更改光标?您描述的行为听起来像是在使用旧游标,而不是用每次/delta调用后返回的游标更新游标。用代码更新。@atwyman Yep。每次打电话我都会更新。(见守则)