Tools
Записки программиста, обо всем и ни о чем. Но, наверное, больше профессионального.
2012-04-28
Can you use Google Maps imagery in an ArcGIS Silverlight Viewer?
Posted by Valentin at 01:28 0 comments
2012-04-26
Веб-картография
UPD
Я нашел решение проблемы. Как оказалось, это не бага, это фича. Глубоко в недрах вьювера есть параметр
MapApplication.Current.Map.SnapToLevels
если задать его
MapApplication.Current.Map.SnapToLevels = true;
то вьювер перестает заниматься отсебятиной.
Posted by Valentin at 22:09 1 comments
Олдскульный Zope Product 2 egg
zopectl test
[buildout] parts = zopeskel paster instance extends = http://download.zope.org/Zope2/index/2.13.13/versions.cfg [zopeskel] recipe = zc.recipe.egg eggs = ZopeSkel<2.99 [paster] recipe = zc.recipe.egg eggs = PasteScript ZopeSkel<2.99 [instance] recipe = zc.recipe.egg eggs = Zope2 Products.ZSQLMethods interpreter = zopepy scripts = runzope zopectl initialization = import sys sys.argv[1:1] = ['-C', r'${buildout:directory}\etc\zope.conf'] |
C:\d\Zope>call setenv.cmd C:\d\Zope>cd zope213 C:\d\Zope\zope213>bin\buildout.exe |
c:\d\Zope\zope213\bin\paster.exe c:\d\Zope\zope213\bin\zopeskel.exe
... [zopeskel] recipe = zc.recipe.egg eggs = ZopeSkel<2.99 zopeskel.dexterity ${instance:eggs} ... |
C:\d\Zope\zope213>bin\runzope.exe Traceback (most recent call last): File "C:\d\Zope\zope213\bin\runzope-script.py", line 92, in <module> Zope2.Startup.run.run() File "c:\d\zope\zope213\eggs\zope2-2.13.13-py2.7.egg\Zope2\Startup\run.py", line 19, in run opts = _setconfig() File "c:\d\zope\zope213\eggs\zope2-2.13.13-py2.7.egg\Zope2\Startup\run.py", line 50, in _setconfig handlers.handleConfig(opts.configroot, opts.confighandlers) File "c:\d\zope\zope213\eggs\zope2-2.13.13-py2.7.egg\Zope2\Startup\handlers.py", line 193, in handleConfig return multihandler(handlers) TypeError: 'NoneType' object is not callable |
import sys sys.argv[1:1] = ['-C', r'C:\d\Zope\zope213\etc\zope.conf']
C:\d\Zope\zope213>bin\zopeskel.exe basic_zope Products.vcufile
namespace_package: Products
package: vcufile
zip_safe: False
basic_zope: A Zope project This creates a Zope project without any specific Plone features. If at any point, you need additional help for a question, you can enter '?' and press RETURN. Expert Mode? (What question mode would you like? (easy/expert/all)?) ['easy']: Version (Version number for project) ['1.0']: 3.0.0 Description (One-line description of the project) ['']: Zope2 Product for huge files chunked upload Creating directory .\Products.vcufile c:\d\zope\zope213\eggs\cheetah-2.2.1-py2.7.egg\Cheetah\Compiler.py:1523: UserWarning: You don't have the C version of NameMapper installed! I'm disabling Cheetah's useStackFrames option as it is painfully slow with the Python version of NameMapper. You should get a copy of Cheetah with the compiled C version of NameMapper. "\nYou don't have the C version of NameMapper installed! " Replace 0 bytes with 2 bytes (0/0 lines changed; 1 lines added) Replace 244 bytes with 2 bytes (6/6 lines changed; 5 lines removed) |
c:\d\Zope\zope213\Products.vcufile │ Products.vcufile-configure.zcml │ README.txt │ setup.py │ ├───docs │ HISTORY.txt │ ├───Products │ │ __init__.py │ │ │ └───vcufile │ configure.zcml │ README.txt │ tests.py │ zope2.py │ __init__.py │ └───Products.vcufile.egg-info dependency_links.txt entry_points.txt namespace_packages.txt not-zip-safe PKG-INFO requires.txt SOURCES.txt top_level.txt |
c:\d\Zope\zope213\Products.vcufile\Products\vcufile
c:\d\Zope\zope213\Products.vcufile │ Products.vcufile-configure.zcml │ README.txt │ setup.py │ ├───docs │ HISTORY.txt │ ├───Products │ │ vcufile.egg.template.rar │ │ __init__.py │ │ │ └───vcufile │ │ CHANGES.txt │ │ configure.zcml │ │ DEPENDENCIES.txt │ │ HISTORY.txt │ │ INSTALL.txt │ │ LICENSE.txt │ │ README.txt │ │ TODO.txt │ │ uploads_const.py │ │ vcufile.py │ │ vcufileproduct.py │ │ VERSION.txt │ │ __init__.py │ │ │ ├───help │ │ VCUFile.stx │ │ │ ├───static │ │ vcu.sl.client.js │ │ │ ├───tests │ │ testVCUFile.py │ │ __init__.py │ │ │ └───www │ vcufile.png │ vcufile16.png │ vcuFileAdd.dtml │ vcuFileEdit.dtml │ vcuFileView.zpt │ └───Products.vcufile.egg-info dependency_links.txt entry_points.txt namespace_packages.txt not-zip-safe PKG-INFO requires.txt SOURCES.txt top_level.txt |
c:\d\Zope\zope213\Products\vcufile
c:\d\Zope\zope213\src\Products.vcufile
[buildout] parts = zopeskel paster instance extends = http://download.zope.org/Zope2/index/2.13.13/versions.cfg develop = src/Products.vcufile [zopeskel] recipe = zc.recipe.egg eggs = ZopeSkel<2.99 [paster] recipe = zc.recipe.egg eggs = PasteScript ZopeSkel<2.99 [instance] recipe = zc.recipe.egg eggs = Zope2 Products.ZSQLMethods Products.vcufile interpreter = zopepy scripts = runzope zopectl initialization = import sys sys.argv[1:1] = ['-C', r'${buildout:directory}\etc\zope.conf'] |
C:\d\Zope\zope213>bin\buildout.exe
[buildout] parts = zopeskel paster test instance extends = http://download.zope.org/Zope2/index/2.13.13/versions.cfg develop = src/Products.vcufile [zopeskel] recipe = zc.recipe.egg eggs = ZopeSkel<2.99 [paster] recipe = zc.recipe.egg eggs = PasteScript ZopeSkel<2.99 [test] recipe = zc.recipe.testrunner defaults = ['--auto-color', '--auto-progress'] eggs = ${instance:eggs} [instance] recipe = zc.recipe.egg eggs = Zope2 Products.ZSQLMethods Products.vcufile interpreter = zopepy scripts = runzope zopectl initialization = import sys sys.argv[1:1] = ['-C', r'${buildout:directory}\etc\zope.conf'] |
c:\d\Zope\zope213\bin\test.exe
C:\d\Zope\zope213>bin\test -s Products.vcufile Running zope.testing.testrunner.layer.UnitTests tests: Set up zope.testing.testrunner.layer.UnitTests in 0.000 seconds. Running: Ran 1 tests with 0 failures and 0 errors in 0.000 seconds. Tearing down left over layers: Tear down zope.testing.testrunner.layer.UnitTests in 0.000 seconds. |
# This file is needed to make this a package. |
import os import unittest import ZODB # dead goat import Products.vcufile.tests from Products.vcufile.vcufileproduct import VCUFileProduct import App.config class testVCUFile(unittest.TestCase): def setUp(self): self._old = App.config.getConfiguration() cfg = App.config.DefaultConfiguration() cfg.instancehome = os.path.dirname( Products.vcufile.tests.__file__) App.config.setConfiguration(cfg) def tearDown(self): App.config.setConfiguration(self._old) def testFID(self): vf = VCUFileProduct('123', '456') self.assertEqual(vf.getFID(), '') state = vf.__getstate__() vf2 = VCUFileProduct.__basicnew__() vf2.__setstate__(state) self.assertEqual(vf2.getFID(), '') self.failIf(state.has_key('func_defaults')) def test_suite(): return unittest.makeSuite(testVCUFile) def package_home(globals_dict): __name__=globals_dict['__name__'] m=sys.modules[__name__] if hasattr(m,'__path__'): r=m.__path__[0] elif "." in __name__: r=sys.modules[__name__.split('.',1)[0]].__path__[0] else: r=__name__ return os.path.abspath(r) if __name__=='__main__': unittest.main(defaultTest='test_suite') |
Posted by Valentin at 16:18 0 comments
Labels: development, Zope(Plone)
2012-04-25
Zope Product testing/debugging
call setenv.cmd pushd %INSTANCE_HOME% start cmd.exe /k "bin\zopectl debug" |
chcp 1251 > nul set wd=%~dp0 pushd "%wd%" set INSTANCE_HOME=c:\d\Zope\zope213 set PYTHONPATH= set path=c:\d\Python27;c:\d\Python27\Scripts;%path% set proxy=http://proxy.algis.com:3128 set http_proxy=%proxy% set ftp_proxy=%proxy% set all_proxy=%proxy% |
>>> import runpy >>> x = runpy.run_module('Products.vcufile.vcufileproduct', run_name='__main__', alter_sys=True) |
__doc__ = """VCUFile product module. The VCUFile Addon works like the Zope File product, but stores the uploaded file externally and can upload giant files because of chunked upload. Doctests for VCU File Zope Product. Create new object >>> x = VCUFileProduct('123', '456') >>> x.id '123' >>> x.title '456' """ __version__ = '3.0.0.alpha' ... if __name__ == "__main__": import doctest doctest.testmod(verbose=True) |
for Zope 2.8 and newer should use the logging module from Python's
standard library directly.
import logging logger = logging.getLogger('VCUFile') ... def __init__(self, id, filename): logger.debug('VCUFileProduct.__init__') ... |
<eventlog> level debug <logfile> path $INSTANCE/log/event.log level info </logfile> </eventlog> |
2012-04-24 21:54:38 DEBUG VCUFile VCUFileProduct.__init__
Posted by Valentin at 01:34 0 comments
Labels: development, Zope(Plone)
2012-04-24
Звериный оскал
Уважаемый пользователь!
По Вашему обращению сообщаем: на данный момент услуга "Получение международного водительского удостоверения" работает корректно.
Рекомендуем воспользоваться данной услугой повторно.
Благодарим за обращение на Единый портал государственных и муниципальных услуг.
Анализ поступающих вопросов и предложений помогает нам улучшать работу Портала.
С уважением,
Служба поддержки пользователей
Единого портала государственных и муниципальных услуг.
Центр телефонного обслуживания: 8(800)100-70 -10http://gosuslugi.ru
12.03.2012 17:06 - Администрация сайта gosuslugi.ru написал(а):
Тема обращения: Личный кабинет. Технические ошибки при работе
Здравствуйте. Второй день подряд я пытаюсь отправить заявление на замену водительского удостоверения. Безуспешно. Я заполняю анкету, дохожу до пункта "отправить" и после отправки стабильно получаю сообщение "портал временно недоступен, приносим извинения за неудобство". Нечто в этом духе. Что не так? Когда я смогу уже подать заявление? Благодарю за внимание. Информация о пользователе: Браузер: Mozilla/5.0 (Windows NT 5.2) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.79 Safari/535.11 IP: 127.0.0.1
Хочется отметить сразу несколько моментов. Во-первых — оперативность. Двух месяцев не прошло. Во вторых точность. Мне сообщают о получении международного удостоверения, хотя я упоминал замену драйверской лицензии. В третьих, доброжелательность приглашения воспользоваться услугой повторно, несмотря на то, что я уж несколько недель как с новыми «правами». А если учесть, что именно эта портальная услуга никак не помогает права заменить, предложение расценивается как особо ценное.
Posted by Valentin at 03:24 0 comments
Labels: gov.ru
2012-04-23
Гражданская мышцА
Posted by Valentin at 01:09 0 comments
2012-04-22
Билли
Posted by Valentin at 04:11 2 comments
Labels: бытовуха
2012-04-19
Erlang
Posted by Valentin at 22:47 0 comments
Labels: hiload, language, web-develop
2012-04-17
Zope Product static content (resources)
<configure xmlns:browser="http://namespaces.zope.org/browser"> <browser:resourceDirectory name="vcufile" directory="static" /> </configure> |
<script type="text/javascript" src="/++resource++vcufile/vcu.sl.client-20120416.js"></script>
Posted by Valentin at 17:00 0 comments
Labels: python, web-develop, Zope(Plone)
2012-04-16
Space Shuttle
Posted by Valentin at 19:03 0 comments
Labels: video
2012-04-14
Real-Time GIS Services
Posted by Valentin at 01:31 0 comments
Labels: GIS, opensource, web-develop
2012-04-13
Черная пятница
Posted by Valentin at 18:14 2 comments
2012-04-12
О демократии
Posted by Valentin at 01:47 0 comments
2012-04-11
Госуслуги, ГИБДД
Posted by Valentin at 01:25 2 comments
2012-04-10
Экранные клавиатуры
Posted by Valentin at 03:14 0 comments
2012-04-09
Maximized window
from Tkinter import * gui = Tk() gui.state('zoomed')
#gui.overrideredirect(True) #gui.iconify() # affects zoomed
from Tkinter import * root = Tk() ... if sys.platform != 'linux2': root.wm_state('zoomed') else: root.wm_attributes('-zoomed', True)
Posted by Valentin at 02:51 0 comments
Labels: howto, programming, python
2012-04-07
CartoDB
Posted by Valentin at 00:45 0 comments
Labels: GIS, opensource
2012-04-06
MapBox
Posted by Valentin at 02:11 0 comments
Labels: GIS, opensource
2012-04-05
+ISO -CD
$ wget http://www.fdos.org/bootdisks/autogen/FDSTD.144.gz
$ gunzip FDSTD.144.gz $ mkdir mnt $ sudo mount -o loop FDSTD.144 mnt
$ sudo cp AFUDOS.exe P5P80014.ROM mnt $ sudo umount mnt
$ genisoimage -o fdos-boot.iso -b FDSTD.144 FDSTD.144
To create a bootable CD-ROM, just add your files, edit the CD's volume, and startup file, run included MAKEISO.BAT, and then burn the generated FDOEM.ISO using your normal CD Writing program. Please make sure you distribute FDOEMCD.source.zip with the ISO image you distribute.
See README.TXT for details, in particular the QUICK USAGE Appendix.
Last modified Sunday February 13, 2005.
FDOEMCD.source.zip - Redistributable source (only needed if you intend to redistribute your ISO image or physical CD-ROM) for included FreeDOS and other programs, 1874KB
FDOEMCD.source-tools.zip - Source for programs used to build the ISO image, but not distributed with it (only needed if you intend to redistribute FDOEMCD.builder.zip), 2887KB
Posted by Valentin at 01:27 0 comments
2012-04-04
Пусть сами жрут спам
Posted by Valentin at 04:08 0 comments
Labels: messaging
2012-04-03
Память
Posted by Valentin at 01:28 0 comments
Архив блога
-
▼
2012
(275)
-
▼
апреля
(21)
- Can you use Google Maps imagery in an ArcGIS Silve...
- Веб-картография
- Олдскульный Zope Product 2 egg
- Zope Product testing/debugging
- Звериный оскал
- Гражданская мышцА
- Билли
- Erlang
- Zope Product static content (resources)
- Space Shuttle
- Real-Time GIS Services
- Черная пятница
- О демократии
- Госуслуги, ГИБДД
- Экранные клавиатуры
- Maximized window
- CartoDB
- MapBox
- +ISO -CD
- Пусть сами жрут спам
- Память
-
▼
апреля
(21)