if(upperLimit > (self.topbaseConstrant.constant * -1))
{
self.topbaseConstrant.constant += gestureRecognizer.translationInView(self.view!).y
gestureRecognizer.setTranslation(CGPointZero, inView: self.view!)
}
目录为空。它应该包含我的Vagrantfile所在的工作空间。我可以/vagrant
,但它是空的。
Vagrantfile
cd /vagrant
答案 0 :(得分:9)
当vagrant无法修改session = requests.Session()
session.proxies = {local_proxy}
cookies = LWPCookieJar('cookiejar')
url = 'http://www.whoscored.com/Regions/252/Tournaments/2/England-Premier-League'
headers = {
'authority': 'www.whoscored.com',
'method': 'GET',
'path': '/',
'scheme': 'https',
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'accept-encoding': 'gzip, deflate, sdch, br',
'accept-language': 'en-GB,en-US;q=0.8,en;q=0.6',
'cache-control': 'max-age=0',
'referer': 'https://www.google.co.uk/',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36'
}
response = session.get(url, headers=headers) # url is blocked by incapsula
response = crack(session, response) # url is no longer blocked by incapsula
regex = re.compile("'Model-Last-Mode': '.*?'", re.S)
my_header = re.search(regex, response.text)
my_header2 = my_header.group()
my_header3 = my_header2.replace("'Model-Last-Mode': '", '').replace("'", "")
print my_header3
并尝试从主机安装当前工作目录时,会发生这种情况。确保它具有挂载目录的权限。
在Vagrant来宾VM上运行此操作,然后注销。
/etc/fstab
在主机上运行。
$ sudo /etc/init.d/vboxadd setup
答案 1 :(得分:0)
你需要在vagrantfile中定义下面的行,。表示当前目录
config.vm.synced_folder ".", "/vagrant"
答案 2 :(得分:0)
手动重启虚拟机(即sudo reboot
)后,这个问题发生了。
从主机重新启动计算机为我解决了问题:
$ vagrant halt
$ vagrant up