This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace Acme\DemoBundle\Form\Type; | |
| use Symfony\Component\Form\AbstractType; | |
| use Symfony\Component\Form\FormBuilder; | |
| class PictureType extends AbstractType | |
| { | |
| public function buildForm(FormBuilder $builder, array $options) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| private function getErrorMessages(\Symfony\Component\Form\Form $form) { | |
| $errors = array(); | |
| foreach ($form->getErrors() as $key => $error) { | |
| $errors[$key] = $error->getMessage(); | |
| } | |
| if ($form->hasChildren()) { | |
| foreach ($form->getChildren() as $child) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $app->register(new Silex\Provider\TranslationServiceProvider(), array( | |
| 'locale' => 'sr_Latn', | |
| 'translation.class_path' => __DIR__ . '/../vendor/symfony/src', | |
| 'translator.messages' => array() | |
| )); | |
| $app['translator']->addLoader('xlf', new Symfony\Component\Translation\Loader\XliffFileLoader()); | |
| $app['translator']->addResource('xlf', __DIR__ . '/../vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.sr_Latn.xlf', 'sr_Latn', 'validators'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| include __DIR__ . '/../vendor/silex/autoload.php'; | |
| use Symfony\Component\HttpFoundation\Response; | |
| use Symfony\Component\HttpKernel\Exception\HttpException; | |
| use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | |
| $app = new Silex\Application(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| client, path = get_transport_and_path('git://github.com/jelmer/dulwich.git') | |
| repo = Repo('/home/umpirsky/Projects/Python/dullwich') | |
| remote_refs = client.fetch(path, repo) | |
| for commit in repo.revision_history(remote_refs['refs/heads/master'])[:3]: | |
| for t in repo.object_store.tree_changes(commit.parents[0], commit.tree): | |
| print t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Traceback (most recent call last): | |
| write_tree_diff(sys.stdout, repo.object_store, commit.parents[0], commit.tree) | |
| File "/usr/lib/python2.7/dist-packages/dulwich/patch.py", line 209, in write_tree_diff | |
| for (oldpath, newpath), (oldmode, newmode), (oldsha, newsha) in changes: | |
| File "/usr/lib/python2.7/dist-packages/dulwich/object_store.py", line 141, in tree_changes | |
| want_unchanged=want_unchanged): | |
| File "/usr/lib/python2.7/dist-packages/dulwich/diff_tree.py", line 168, in tree_changes | |
| for entry1, entry2 in entries: | |
| File "/usr/lib/python2.7/dist-packages/dulwich/diff_tree.py", line 145, in walk_trees | |
| todo.extend(reversed(_merge_entries(path, tree1, tree2))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| client, path = get_transport_and_path('git://github.com/jelmer/dulwich.git') | |
| repo = Repo('/home/umpirsky/Projects/Python/dullwich') | |
| remote_refs = client.fetch(path, repo) | |
| for commit in repo.revision_history(remote_refs['refs/heads/master'])[:3]: | |
| write_tree_diff(sys.stdout, repo.object_store, commit.parents[0], commit.tree) | |
| sys.exit() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| client, path = get_transport_and_path('git://github.com/jelmer/dulwich.git') | |
| repo = Repo('/home/umpirsky/Projects/Python/dullwich') | |
| remote_refs = client.fetch(path, repo) | |
| for k, remote_ref in remote_refs.iteritems(): | |
| print repo[remote_ref] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $sudo python setup.py install --prefix=/usr/local | |
| /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'zip_safe' | |
| warnings.warn(msg) | |
| /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'include_package_data' | |
| warnings.warn(msg) | |
| running install | |
| running build | |
| running build_py | |
| running build_scripts | |
| running install_lib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RECORD_TYPE_TEST = 'http://umpirsky.com/record-type/test' | |
| db = CouchDatabase('desktopcouchbug', create=True) | |
| ##db.put_record(Record({ | |
| ## 'record_type': RECORD_TYPE_TEST, | |
| ## 'name': 'test record', | |
| ## 'dict': {} | |
| ##})) | |
| record = db.get_record('5h5FK4cMbvgSheFDoY5mPT') | |
| record['dict']['1'] = {'path': 'foo'} |