{ "info": { "author": "JC Brand", "author_email": "brand@syslab.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Full readme with doctests in slc/autotranslate/README.txt\n\nIntroduction\n============\n\nThis product adds a boolean 'autoTranslateUploadedFiles' on all BaseFolder based\nfolders, which enables any uploaded files to be automatically translated. \n\n'Translation' here merely refers to a procedure whereby the file's language \nis identified and its language code set accordingly (via setLanguage).\n\nThe language that the file will be translated into, is determined form the file's\nname. The file name must be prefixed or suffixed with a language code, followed\n(or preceded) with an underscore.\n\nThe following are valid file names:\n \n - de_factsheet.pdf\n - factsheet_de.pdf\n\nHow To Use (Doc Tests):\n=======================\n\nFirst, we import everything we need:\n\n >>> from z3c.widget.flashupload.interfaces import FlashUploadedEvent\n >>> from Products.Archetypes.event import ObjectInitializedEvent\n >>> from zope import event\n\nWe will create the folder in which we upload our test files inside the test\nuser's Member folder.\n\n >>> self.folder.invokeFactory('Folder', 'publications')\n 'publications'\n >>> folder = self.folder._getOb('publications')\n\nTo enable the autotranslation feature, we must set the 'autoTranslateUploadedFiles' \nfield on the parent folder. \n\nThis is a field added via schema-extension, so we cannot use an Archetypes\ngenerated mutator.\n\n >>> folder.Schema().get('autoTranslateUploadedFiles', True).set(folder, True)\n\nNow we simulate the uploading of 2 files via PloneFlashUpload.\nEach time we create a file inside our folder, and then call the FlashUploadedEvent.\n\n >>> for fn in ['en_file.txt', 'de_file.txt']:\n ... fid = folder.invokeFactory('File', fn)\n ... file = getattr(folder, fid)\n ... f = open('src/slc.autotranslate/slc/autotranslate/tests/files/%s' % fn)\n ... file.setFile(f)\n ... event.notify(FlashUploadedEvent(file))\n\nLet's see if our uploaded files were set correctly to their indicated languages, \nand also that the canonical was set properly:\n\n >>> file = getattr(folder, 'en_file.txt')\n >>> file.getLanguage()\n 'en'\n\n >>> file.getCanonical()\n \n\n >>> file = getattr(folder, 'de_file.txt')\n \n >>> file.getLanguage()\n 'de'\n\n >>> file.getCanonical()\n \n\nFile names that end with the language code (as apposed to it being prefixed) \nare also valid. We'll test now that this is indeed the case.\n\nFirst we again upload a file, this time file_es.txt (Spanish):\n \n >>> fid = folder.invokeFactory('File', 'file_es.txt')\n >>> file = getattr(folder, fid)\n >>> f = open('src/slc.autotranslate/slc/autotranslate/tests/files/file_es.txt')\n >>> file.setFile(f)\n\nNow we fire the event. This time, we use Archetypes' ObjectInitializedEvent, to\nshow that normally added (as opposed to PloneFlashUpload) files are also translated.\n\n >>> event.notify(ObjectInitializedEvent(file))\n\nLet's test that the file's language and the canonical was set correctly:\n\n >>> file = getattr(folder, 'file_es.txt')\n >>> file.getLanguage()\n 'es'\n\n >>> file.getCanonical()\n \n \n\nFor additional doctests, see the tests/doctests.txt folder.\n\n\nChange history\n**************\n\n\n\n1.5.4 (2010-04-01)\n------------------\n\n- Bugix: Images don't have the getFile method, using getFilename\n instead as this works for both files and images (deroiste)\n\n\n1.5.3 (2010-02-10)\n------------------\n\n- Bugfix for my recently added clause: As cononical might be None, we have\n to consider this possibility in the clause (thomasw)\n- If for whatever reason translate_file is called twice on the same file, it can happen\n that the file is no longer present in the parent, but was already moved to a translation\n of the parent. Therefore make sure the file is still there before trying to\n delete it (thomasw)\n- Prevent calling translate_file twice on the same file by setting a flag. This can happen\n if a file is flash-uploaded. First, the IObjectInitializedEvent is triggered,\n then FlashUploadedEvent. (thomasw)\n\n\n1.5.2 (2010-01-28)\n------------------\n\n- Added a clause to translate_file, that prevents trying to add a translation\n reference if it exists already (causing an AlreadyTranslated err) (thomasw)\n\n\n1.5.1 (2009-12-10)\n------------------\n\n- Small change in default view configuration (jcbrand)\n\n\n1.5 (2009-11-20)\n----------------\n\n- Now works with Products.PloneFlashUpload = 1.3b1; also backwards compatible\n (thomasw)\n\n1.4.3 (2009-10-22)\n------------------\n- call unmarkCreationFlag on an uploaded file; otherwise a PFU uploaded file might trigger\n an IObjectInitializedEvent upon first editing, leading to an AlreadyTranslated error (thomasw)\n\n1.4.2 (2009-10-22)\n------------------\n- Add more detailed logging output (jcbrand)\n- Fix a name in split_filename where files with base names of 2 characters\n weren't processed correctly (jcbrand)\n\nslc.autotranslate 1.4.1 (2009-09-10)\n------------------------------------\n- Call the LinguaPlone events before and after setting the language for an\n uploaded file. (jcbrand)\n- Use addTranslationReference instead of addReference (jcbrand)\n- Copy over the language independent values from the canonical (jcbrand)\n\nslc.autotranslate 1.4 (2009-09-09)\n----------------------------------\n- Search for existing translations also in translated parent folders (jcbrand)\n- Refactored events and moved 'translate_file' method to new module utils.py (jcbrand)\n- Added with new utility methods to utils.py (jcbrand)\n- Extend doctests for the new use-cases. (jcbrand)\n\nslc.autotranslate 1.3 (2009-08-26)\n----------------------------------\n\n- In case of CopyError, manually set the file's language and copy and paste it to the appropriate language version parent. (jcbrand)\n- Extend the doctests to test for more use-cases. (jcbrand) \n\nslc.autotranslate 1.2 (2009-08-24)\n----------------------------------\n\n- Add interlude as package dependency \n\nslc.autotranslate 1.1 (2009-08-21)\n----------------------------------\n\n- Use setLanguage instead of addTranslation (jcbrand)\n- Properly set the canonical and translation references (jcbrand)\n- Add more extensive tests (jcbrnad)\n\nslc.autotranslate 1.0 (2009-08-13)\n----------------------------------\n\n- Initial release. (jcbrand)\n\nContributors\n************\n\n- Jan-Carel Brand (Syslab.com GmbH)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://plone.org/products/slc.autotranslate", "keywords": "plone zope PloneFlashUpload LinguagePlone translate pdf upload slc syslab", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "slc.autotranslate", "package_url": "https://pypi.org/project/slc.autotranslate/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/slc.autotranslate/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://plone.org/products/slc.autotranslate" }, "release_url": "https://pypi.org/project/slc.autotranslate/1.5.4/", "requires_dist": null, "requires_python": null, "summary": "Automatically translate files uploaded by PloneFlashUpload", "version": "1.5.4" }, "last_serial": 163806, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "843ff358a4e9d3022d6bd23a5d40d3ab", "sha256": "46164aca37a1af9bda150dc2af2af839b5f0ccdf6cd5d83772923bdbf2c45670" }, "downloads": -1, "filename": "slc.autotranslate-1.0.tar.gz", "has_sig": false, "md5_digest": "843ff358a4e9d3022d6bd23a5d40d3ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5574, "upload_time": "2009-08-14T12:26:39", "url": "https://files.pythonhosted.org/packages/e3/ee/bd68ebca3f100ff179d40ceaafd71311d5dac5ef336d3d79983ca23ab3d1/slc.autotranslate-1.0.tar.gz" } ], "1.0Beta1": [ { "comment_text": "", "digests": { "md5": "6a721b0f67cfc293eceac5796c043b2c", "sha256": "f6c462ea78c1c978d50addaaa103e102139e3b988985775a3436f18a9b825f26" }, "downloads": -1, "filename": "slc.autotranslate-1.0Beta1.tar.gz", "has_sig": false, "md5_digest": "6a721b0f67cfc293eceac5796c043b2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5026, "upload_time": "2009-08-07T18:05:42", "url": "https://files.pythonhosted.org/packages/40/ee/aa029f8ee44b6166e11451dce1a7cab514b7b54341e9791c423d85809547/slc.autotranslate-1.0Beta1.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "e8bebc04321722836732398c7cb0d72b", "sha256": "4bb1a8e0ab713b507506ebdd6cf67ac48c205d9387fb9cecfb4547cc7b1cf463" }, "downloads": -1, "filename": "slc.autotranslate-1.1.zip", "has_sig": false, "md5_digest": "e8bebc04321722836732398c7cb0d72b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16723, "upload_time": "2009-08-24T12:23:30", "url": "https://files.pythonhosted.org/packages/8a/4e/8975e91866723ed96b8f899aae11c1552515b6cfce841c73468d4ad12e2e/slc.autotranslate-1.1.zip" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "55f888c0372866208862a49868a970f3", "sha256": "3e98a8b0fc1582c1d7d63207a26f633100097748e8fd129e760b4e50dc5dd8e5" }, "downloads": -1, "filename": "slc.autotranslate-1.2.zip", "has_sig": false, "md5_digest": "55f888c0372866208862a49868a970f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16808, "upload_time": "2009-08-24T12:34:24", "url": "https://files.pythonhosted.org/packages/cd/de/87c605dca8e8b62ae075329e0c2e3753b8b89b7fc81199b2d599cc3345e3/slc.autotranslate-1.2.zip" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "74be365ece62db47bd6a3fa994661cbf", "sha256": "97109268ec1c1acd676e8100dd7f7c0907830211ed9107128b448181322dff6a" }, "downloads": -1, "filename": "slc.autotranslate-1.3.zip", "has_sig": false, "md5_digest": "74be365ece62db47bd6a3fa994661cbf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18391, "upload_time": "2009-08-26T11:08:34", "url": "https://files.pythonhosted.org/packages/ca/32/3c0443ecd02a65f019c2a6cee597678e1afcf87206137123593ac1d05d30/slc.autotranslate-1.3.zip" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "640c6ea8c632fba4c0346bbfcec9fec4", "sha256": "f1a3a93df202928faaffab88439fa30d5c7dbd3732207b9bb840fa715b52337b" }, "downloads": -1, "filename": "slc.autotranslate-1.4.zip", "has_sig": false, "md5_digest": "640c6ea8c632fba4c0346bbfcec9fec4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20425, "upload_time": "2009-09-09T22:43:19", "url": "https://files.pythonhosted.org/packages/41/5f/ad83837bc824d3ed4519f7a4af4d720c366e00fecf7db626aa4784ba9f10/slc.autotranslate-1.4.zip" } ], "1.4.1": [ { "comment_text": "", "digests": { "md5": "108c7d49996ccbe6dde043fcc1cadc3d", "sha256": "e76bffe20a851380cac0e1fa068a10ab9f713b2940e9609112d9d0bb17f5615e" }, "downloads": -1, "filename": "slc.autotranslate-1.4.1.zip", "has_sig": false, "md5_digest": "108c7d49996ccbe6dde043fcc1cadc3d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21665, "upload_time": "2009-09-10T13:31:09", "url": "https://files.pythonhosted.org/packages/8f/46/fe72b5a0b9c62d09ee128b51ae6dd7f757c033ac6040635203940e48e82a/slc.autotranslate-1.4.1.zip" } ], "1.4.2": [ { "comment_text": "", "digests": { "md5": "8cef96e8b3b34396b34722969f6a1eb9", "sha256": "3e7ac9c5a32b60f7183a9f45b349039ece4fb5389fe6f3b5e5d039c9473ee7d6" }, "downloads": -1, "filename": "slc.autotranslate-1.4.2.zip", "has_sig": false, "md5_digest": "8cef96e8b3b34396b34722969f6a1eb9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22082, "upload_time": "2009-09-25T14:29:35", "url": "https://files.pythonhosted.org/packages/3d/4c/26357f7cffa44d4c27e383a3ab054dfba11ba26d96c90c5212486609d6c5/slc.autotranslate-1.4.2.zip" } ], "1.5": [ { "comment_text": "", "digests": { "md5": "e51df7a2a1ae5fc0af54e416993e0838", "sha256": "1e9116b1fcf6266628a5e7107a583295cf59d0ffd4b0071da805d63d8fad72c3" }, "downloads": -1, "filename": "slc.autotranslate-1.5.zip", "has_sig": false, "md5_digest": "e51df7a2a1ae5fc0af54e416993e0838", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22582, "upload_time": "2009-11-23T13:38:26", "url": "https://files.pythonhosted.org/packages/db/5f/ff4f20d17d592d5d557bce67da1b7e942079e98f5d2384a4810f114740ae/slc.autotranslate-1.5.zip" } ], "1.5.1": [ { "comment_text": "", "digests": { "md5": "e8abb691bae7b579168ae956741c5622", "sha256": "b1459173863b256bff039ec95bc808619c854da8569834b722c0fdf692dfd200" }, "downloads": -1, "filename": "slc.autotranslate-1.5.1.tar.gz", "has_sig": false, "md5_digest": "e8abb691bae7b579168ae956741c5622", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11592, "upload_time": "2009-12-10T14:46:55", "url": "https://files.pythonhosted.org/packages/0c/0a/32dcc97c62e80d7b2e19e9e092738794b686d4ce44ff5d79fc904f9a0ec8/slc.autotranslate-1.5.1.tar.gz" } ], "1.5.2": [ { "comment_text": "", "digests": { "md5": "5cc1d625ebaab81d147452df6b10ab9c", "sha256": "e2ad62457162d8cb04ea1d33cadc69f7db1f7dd83e66e155e37dbb2dde27ef46" }, "downloads": -1, "filename": "slc.autotranslate-1.5.2.tar.gz", "has_sig": false, "md5_digest": "5cc1d625ebaab81d147452df6b10ab9c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12974, "upload_time": "2010-01-28T11:18:36", "url": "https://files.pythonhosted.org/packages/49/6f/4050b56964bb9f340f13c8003b6d03143f71d9ab60260d5eaed91ec8a3d1/slc.autotranslate-1.5.2.tar.gz" } ], "1.5.3": [ { "comment_text": "", "digests": { "md5": "3542e1e6d29f7089d154b7a05dbe98ae", "sha256": "bf6449a7c7301667f884804920e6957b2c796b5c1fdad7a099ee17db15e5c1de" }, "downloads": -1, "filename": "slc.autotranslate-1.5.3.zip", "has_sig": false, "md5_digest": "3542e1e6d29f7089d154b7a05dbe98ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24097, "upload_time": "2010-02-10T21:30:28", "url": "https://files.pythonhosted.org/packages/10/e0/ce41061d9f356af1d5be6ff2bcbe0490782819bed8b2c7a1f4e39ad1ce25/slc.autotranslate-1.5.3.zip" } ], "1.5.4": [ { "comment_text": "", "digests": { "md5": "66cf8f23fe1fdfda5295cbced3e5cffd", "sha256": "fd63d36ad10b538d83a57e9907b0cecda83171dc06d84dde817160b9edf058d7" }, "downloads": -1, "filename": "slc.autotranslate-1.5.4.tar.gz", "has_sig": false, "md5_digest": "66cf8f23fe1fdfda5295cbced3e5cffd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12187, "upload_time": "2010-04-01T12:43:46", "url": "https://files.pythonhosted.org/packages/05/5d/9fbae02f0b4c3621fdbe763ea62625620368b4f97c1d746f4a63071156d8/slc.autotranslate-1.5.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "66cf8f23fe1fdfda5295cbced3e5cffd", "sha256": "fd63d36ad10b538d83a57e9907b0cecda83171dc06d84dde817160b9edf058d7" }, "downloads": -1, "filename": "slc.autotranslate-1.5.4.tar.gz", "has_sig": false, "md5_digest": "66cf8f23fe1fdfda5295cbced3e5cffd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12187, "upload_time": "2010-04-01T12:43:46", "url": "https://files.pythonhosted.org/packages/05/5d/9fbae02f0b4c3621fdbe763ea62625620368b4f97c1d746f4a63071156d8/slc.autotranslate-1.5.4.tar.gz" } ] }