diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | Cargo.lock | 297 | ||||
-rw-r--r-- | NOTICE | 1338 | ||||
-rw-r--r-- | base/src/context.rs | 1 | ||||
-rw-r--r-- | base/src/dummy.rs | 14 | ||||
-rw-r--r-- | base/src/event.rs | 14 | ||||
-rw-r--r-- | base/src/lib.rs | 14 | ||||
-rw-r--r-- | cli/Cargo.toml | 7 | ||||
-rw-r--r-- | cli/build.rs | 15 | ||||
-rw-r--r-- | cli/src/lib.rs | 120 | ||||
-rw-r--r-- | cli/src/stats.rs | 73 | ||||
-rw-r--r-- | formats/binary/src/lib.rs | 14 | ||||
-rw-r--r-- | formats/energymech/src/lib.rs | 14 | ||||
-rw-r--r-- | formats/irssi/src/lib.rs | 281 | ||||
-rw-r--r-- | formats/msgpack/src/lib.rs | 14 | ||||
-rw-r--r-- | formats/weechat/src/lib.rs | 14 | ||||
-rw-r--r-- | ops/Cargo.toml | 1 | ||||
-rw-r--r-- | ops/src/freq.rs | 92 | ||||
-rw-r--r-- | ops/src/lib.rs | 7 | ||||
-rw-r--r-- | ops/src/stats.rs | 123 | ||||
-rw-r--r-- | src/lib.rs | 15 | ||||
-rw-r--r-- | src/main.rs | 9 | ||||
-rw-r--r-- | warning.rs | 11 |
24 files changed, 1856 insertions, 637 deletions
@@ -1,5 +1,4 @@ .cargo /target **/target -Cargo.lock -**/Cargo.lock +*/**/Cargo.lock diff --git a/.travis.yml b/.travis.yml index 7ed3db1..ae8f01c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ matrix: # may have problems when too many threads are spawned. Also, by the next Rust stable release, # this target will be replaced by `armv7-unknown-linux-gnueabihf`. - os: linux - rust: stable + rust: nightly env: TARGET=arm-unknown-linux-gnueabihf # Extra packages only for this build job addons: diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..b20cf74 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,297 @@ +[root] +name = "ilc" +version = "0.3.0" +dependencies = [ + "flate2 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "ilc-base 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ilc-cli 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ilc-format-energymech 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ilc-format-weechat 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ilc-ops 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "aho-corasick" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ansi_term" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "blist" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "linked-list 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "traverse 0.0.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "chrono" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "clap" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ansi_term 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "vec_map 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "env_logger" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "flate2" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "miniz-sys 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gcc" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "glob" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ilc-base" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "chrono 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ilc-base" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "chrono 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ilc-cli" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "chrono 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "glob 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "ilc-base 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ilc-format-energymech 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ilc-format-weechat 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ilc-ops 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ilc-format-energymech" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "chrono 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "ilc-base 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ilc-format-energymech" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "chrono 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "ilc-base 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ilc-format-weechat" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "chrono 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "ilc-base 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ilc-format-weechat" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "chrono 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "ilc-base 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ilc-ops" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "blist 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ilc-base 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "kernel32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "linked-list" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "memchr" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "miniz-sys" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "gcc 0.3.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex" +version = "0.1.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-syntax" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc-serialize" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "strsim" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "time" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "traverse" +version = "0.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "utf8-ranges" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "vec_map" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + @@ -1,232 +1,1114 @@ -Copyright and License for this (ilc) crate: +Toolchain: /home/till/.multirust/toolchains/beta + Updating registry `https://github.com/rust-lang/crates.io-index` - Copyright 2015 Till Höppner +## License for aho-corasick-0.5.1 +> LICENSE-MIT - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at +The MIT License (MIT) - http://www.apache.org/licenses/LICENSE-2.0 +Copyright (c) 2015 Andrew Gallant - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - -Copyright and License for the bincode crate: - - The MIT License (MIT) - - Copyright (c) 2014 Ty Overby - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -License for the regex, regex_macros, chrono, docopt, rustc-serialize, log, and env_logger crates: - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +## License for ansi_term-0.7.2 +> LICENCE + +The MIT License (MIT) + +Copyright (c) 2014 Benjamin Sago + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +## License for bitflags-0.4.0 +> LICENSE-MIT + +Copyright (c) 2014 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +## License for bit-set-0.3.0 +> LICENSE-MIT + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +## License for bit-vec-0.4.3 +> LICENSE-MIT + +Copyright (c) 2015 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +## License for blist-0.0.4 +> LICENSE-MIT + +Copyright (c) 2015 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +## License for chrono-0.2.19 +> LICENSE.txt + +Rust-chrono is dual-licensed under The MIT License [1] and +Apache 2.0 License [2]. Copyright (c) 2014, Kang Seonghoon. + +Nota Bene: This is same as the Rust Project's own license. + + +[1]: <http://opensource.org/licenses/MIT>, which is reproduced below: + +~~~~ +The MIT License (MIT) + +Copyright (c) 2014, Kang Seonghoon. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +~~~~ + + +[2]: <http://www.apache.org/licenses/LICENSE-2.0>, which is reproduced below: + +~~~~ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +~~~~ + + +## License for clap-2.1.2 +> LICENSE-MIT + +The MIT License (MIT) + +Copyright (c) 2015-2016 Kevin B. Knapp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +## License for env_logger-0.3.2 + +## License for flate2-0.2.13 +> LICENSE-MIT + +Copyright (c) 2014 Alex Crichton + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +## License for gcc-0.3.25 +> LICENSE-MIT + +Copyright (c) 2014 Alex Crichton + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +## License for glob-0.2.10 +> LICENSE-MIT + +Copyright (c) 2014 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +## License for includedir-0.2.1 + +## License for includedir_codegen-0.2.1 + +## License for kernel32-sys-0.2.1 + +## License for libc-0.2.7 +> LICENSE-MIT + +Copyright (c) 2014 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +## License for linked-list-0.0.3 +> LICENSE-MIT + +Copyright (c) 2015 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +## License for log-0.3.5 +> LICENSE-MIT + +Copyright (c) 2014 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +## License for memchr-0.1.10 +> LICENSE-MIT + +The MIT License (MIT) + +Copyright (c) 2015 Andrew Gallant + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +## License for miniz-sys-0.1.7 + +## License for num-0.1.31 +> LICENSE-MIT + +Copyright (c) 2014 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +## License for phf-0.7.13 + +## License for phf_codegen-0.7.13 + +## License for phf_generator-0.7.13 + +## License for phf_shared-0.7.13 + +## License for rand-0.3.14 +> LICENSE-MIT + +Copyright (c) 2014 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +## License for regex-0.1.54 +> LICENSE-MIT + +Copyright (c) 2014 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +## License for regex-syntax-0.2.5 + +## License for rustc-serialize-0.3.18 +> LICENSE-MIT + +Copyright (c) 2014 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +## License for serde-0.7.0 + +## License for serde_json-0.7.0 + +## License for strsim-0.4.0 +> LICENSE + +The MIT License (MIT) + +Copyright (c) 2015 Danny Guo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +## License for time-0.1.34 +> LICENSE-MIT + +Copyright (c) 2014 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +## License for traverse-0.0.12 + +## License for utf8-ranges-0.1.3 +> LICENSE-MIT + +The MIT License (MIT) + +Copyright (c) 2015 Andrew Gallant + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +## License for vec_map-0.4.0 +> LICENSE-MIT + +Copyright (c) 2015 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +## License for walkdir-0.1.5 +> LICENSE-MIT + +The MIT License (MIT) + +Copyright (c) 2015 Andrew Gallant + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +## License for winapi-0.2.5 +> LICENSE.md + +The MIT License (MIT) + +Copyright (c) 2015 Peter Atashian + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +## License for winapi-build-0.1.1 diff --git a/base/src/context.rs b/base/src/context.rs index fe264ab..c49ef23 100644 --- a/base/src/context.rs +++ b/base/src/context.rs @@ -1,4 +1,3 @@ - use chrono::naive::date::NaiveDate; use chrono::offset::fixed::FixedOffset; diff --git a/base/src/dummy.rs b/base/src/dummy.rs index a0ab8b4..2a91235 100644 --- a/base/src/dummy.rs +++ b/base/src/dummy.rs @@ -1,17 +1,3 @@ -// Copyright 2015 Till Höppner -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - use std::iter; use std::io::BufRead; diff --git a/base/src/event.rs b/base/src/event.rs index e357800..745cc64 100644 --- a/base/src/event.rs +++ b/base/src/event.rs @@ -1,17 +1,3 @@ -// Copyright 2015 Till Höppner -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - //! Common structures to represent the actual log data in memory. //! These will be used by all formats for encoding and decoding. diff --git a/base/src/lib.rs b/base/src/lib.rs index f2777e3..a9349cc 100644 --- a/base/src/lib.rs +++ b/base/src/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2015 Till Höppner -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - extern crate chrono; #[macro_use] extern crate log; diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 8e66b7e..e958ef5 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -6,6 +6,7 @@ homepage = "https://github.com/tilpner/ilc" license = "Apache-2.0" repository = "https://github.com/tilpner/ilc" authors = ["Till Höppner <till@hoeppner.ws>"] +build = "build.rs" [features] default = ["ilc-format-weechat", "ilc-format-energymech"] @@ -14,9 +15,15 @@ default = ["ilc-format-weechat", "ilc-format-energymech"] log = "0.3.5" clap = "2.1.2" chrono = "0.2.19" +serde = "~0.7" +serde_json = "~0.7" env_logger = "0.3.2" glob = "0.2.10" ilc-base = "~0.2" ilc-ops = "~0.1" ilc-format-weechat = { optional = true, version = "~0.2" } ilc-format-energymech = { optional = true, version = "~0.2" } +includedir = "~0.2" + +[build-dependencies] +includedir_codegen = "~0.2" diff --git a/cli/build.rs b/cli/build.rs new file mode 100644 index 0000000..e83c21a --- /dev/null +++ b/cli/build.rs @@ -0,0 +1,15 @@ +extern crate includedir_codegen; + +use std::env; + +use includedir_codegen::Compression; + +fn main() { + let mut cg = includedir_codegen::start("FILES"); + if env::var("PASSTHROUGH").is_ok() { + cg.passthrough(); + } + cg.dir("../templates", Compression::Gzip) + .build("data.rs") + .unwrap(); +} diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 9469cfb..ba7f792 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2015 Till Höppner -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - extern crate ilc_base; extern crate ilc_ops; extern crate ilc_format_weechat; @@ -22,10 +8,11 @@ extern crate clap; #[macro_use] extern crate log; extern crate env_logger; +extern crate serde; +extern crate serde_json; extern crate glob; use ilc_base::{Context, Decode, Encode}; -use ilc_ops::*; use ilc_format_weechat::Weechat; use ilc_format_energymech::Energymech; @@ -40,19 +27,26 @@ use std::fs::File; use std::path::{Path, PathBuf}; use std::ffi::OsStr; use std::io::{self, BufRead, BufReader, BufWriter, Write}; -use std::{process, usize}; +use std::process; use std::error::Error; mod chain; +mod stats; + +pub struct Cli { + pub version: String, + pub master_hash: String, +} -pub fn main() { +pub fn main(cli: Cli) { env_logger::init().unwrap(); if option_env!("FUSE").is_some() { info!("Compiled with FUSEs") } + let version = format!("{} ({})", cli.version, cli.master_hash); let args = App::new("ilc") - .version(crate_version!()) + .version(&version[..]) .setting(AppSettings::GlobalVersion) .setting(AppSettings::VersionlessSubcommands) .setting(AppSettings::ArgRequiredElseHelp) @@ -115,12 +109,12 @@ pub fn main() { .about("Parse the input, checking the format")) .subcommand(SubCommand::with_name("convert") .about("Convert from a source to a target format")) - .subcommand(SubCommand::with_name("freq") + .subcommand(SubCommand::with_name("stats") .about("Analyse the activity of users by certain metrics") - .arg(Arg::with_name("count") + /*.arg(Arg::with_name("count") .help("The number of items to be displayed") .takes_value(true) - .long("count"))) + .long("count"))*/) .subcommand(SubCommand::with_name("seen") .about("Print the last line a nick was active") .arg(Arg::with_name("nick") @@ -139,68 +133,61 @@ pub fn main() { let res = match args.subcommand() { ("parse", Some(args)) => { let e = Environment(&args); - parse::parse(&e.context(), &mut e.input(), &mut *e.decoder()) + ilc_ops::parse::parse(&e.context(), &mut e.input(), &mut *e.decoder()) } ("convert", Some(args)) => { let e = Environment(&args); - convert::convert(&e.context(), - &mut e.input(), - &mut *e.decoder(), - &mut *e.output(), - &*e.encoder()) + ilc_ops::convert::convert(&e.context(), + &mut e.input(), + &mut *e.decoder(), + &mut *e.output(), + &*e.encoder()) } - ("freq", Some(args)) => { + ("stats", Some(args)) => { let e = Environment(&args); - let count = value_t!(args, "count", usize).unwrap_or(usize::MAX); - freq::freq(count, - &e.context(), - &mut e.input(), - &mut *e.decoder(), - &mut e.output()) + let stats = ilc_ops::stats::stats(&e.context(), &mut e.input(), &mut *e.decoder()) + .unwrap_or_else(|e| error(Box::new(e))); + + stats::output_as_json(&args, &cli, stats) } ("seen", Some(args)) => { let e = Environment(&args); let nick = args.value_of("nick").expect("Required argument <nick> not present"); - seen::seen(nick, - &e.context(), - &mut e.input(), - &mut *e.decoder(), - &mut *e.output(), - &Weechat) + ilc_ops::seen::seen(nick, + &e.context(), + &mut e.input(), + &mut *e.decoder(), + &mut *e.output(), + &Weechat) } ("sort", Some(args)) => { let e = Environment(&args); - sort::sort(&e.context(), - &mut e.input(), - &mut *e.decoder(), - &mut *e.output(), - &*e.encoder()) + ilc_ops::sort::sort(&e.context(), + &mut e.input(), + &mut *e.decoder(), + &mut *e.output(), + &*e.encoder()) } ("dedup", Some(args)) => { let e = Environment(&args); - dedup::dedup(&e.context(), - &mut e.input(), - &mut *e.decoder(), - &mut *e.output(), - &*e.encoder()) + ilc_ops::dedup::dedup(&e.context(), + &mut e.input(), + &mut *e.decoder(), + &mut *e.output(), + &*e.encoder()) } ("merge", Some(args)) => { let e = Environment(&args); let mut inputs = e.inputs(); - // let mut decoders = e.decoders(); - let borrowed_inputs = inputs.iter_mut() .map(|a| a as &mut BufRead) .collect(); - // let borrowed_decoders = decoders.iter_mut() - // .map(|a| &mut **a as &mut Decode) - // .collect(); - merge::merge(&e.context(), - borrowed_inputs, - &mut *e.decoder(), - &mut *e.output(), - &*e.encoder()) + ilc_ops::merge::merge(&e.context(), + borrowed_inputs, + &mut *e.decoder(), + &mut *e.output(), + &*e.encoder()) } (sc, _) if !sc.is_empty() => panic!("Unimplemented subcommand `{}`, this is a bug", sc), _ => die("No command specified"), @@ -302,19 +289,6 @@ impl<'a> Environment<'a> { force_decoder(self.0.value_of("format").or(self.0.value_of("input_format"))) } - /* pub fn decoders(&self) -> Vec<Box<Decode>> { - * self.0 - * .value_of("format") - * .into_iter() - * .chain(self.0 - * .values_of("input_formats") - * .map(|i| Box::new(i) as Box<Iterator<Item = _>>) - * .unwrap_or(Box::new(iter::empty()) as Box<Iterator<Item = _>>)) - * .map(Option::Some) - * .map(force_decoder) - * .collect() - * } */ - pub fn encoder(&self) -> Box<Encode> { force_encoder(self.0.value_of("format").or(self.0.value_of("output_format"))) } diff --git a/cli/src/stats.rs b/cli/src/stats.rs new file mode 100644 index 0000000..390a200 --- /dev/null +++ b/cli/src/stats.rs @@ -0,0 +1,73 @@ +use clap::ArgMatches; + +use chrono::Local; + +use serde_json; +use serde::ser::{MapVisitor, Serialize, Serializer}; + +use ilc_base; +use ilc_ops::stats::Stats; +use Environment; +use Cli; +use error; + +struct StatFormat { + version: String, + master_hash: String, + time: String, + stats: Stats, +} + +impl Serialize for StatFormat { + fn serialize<S>(&self, s: &mut S) -> Result<(), S::Error> + where S: Serializer + { + struct Visitor<'a>(&'a StatFormat); + impl<'a> MapVisitor for Visitor<'a> { + fn visit<S>(&mut self, s: &mut S) -> Result<Option<()>, S::Error> + where S: Serializer + { + try!(s.serialize_struct_elt("version", &self.0.version)); + try!(s.serialize_struct_elt("master_hash", &self.0.master_hash)); + try!(s.serialize_struct_elt("time", &self.0.time)); + try!(s.serialize_struct_elt("stats", &self.0.stats)); + Ok(None) + } + + fn len(&self) -> Option<usize> { + Some(4) + } + } + s.serialize_struct("StatFormat", Visitor(self)) + } +} + + +pub fn output_as_json(args: &ArgMatches, cli: &Cli, stats: Stats) -> ilc_base::Result<()> { + let e = Environment(args); + // let count = value_t!(args, "count", usize).unwrap_or(usize::MAX); + // let mut stats: Vec<(String, Person)> = stats.into_iter().collect(); + // stats.sort_by(|&(_, ref a), &(_, ref b)| b.words.cmp(&a.words)); + + // for &(ref name, ref stat) in stats.iter().take(count) { + + let format = StatFormat { + version: cli.version.clone(), + master_hash: cli.master_hash.clone(), + time: Local::now().to_rfc2822(), + stats: stats, + }; + + serde_json::to_writer_pretty(&mut e.output(), &format).unwrap_or_else(|e| error(Box::new(e))); + /* write!(&mut *e.output(), + * "{}:\n\tTotal lines: {}\n\tLines without alphabetic characters: {}\n\tTotal \ + * words: {}\n\tWords per line: {}\n", + * name, + * stat.lines, + * stat.lines - stat.alpha_lines, + * stat.words, + * stat.words as f32 / stat.lines as f32) + * .unwrap_or_else(|e| error(Box::new(e))); */ + // } + Ok(()) +} diff --git a/formats/binary/src/lib.rs b/formats/binary/src/lib.rs index 7cc4281..e95804d 100644 --- a/formats/binary/src/lib.rs +++ b/formats/binary/src/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2015 Till Höppner -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - use std::io::{BufRead, Write}; use std::iter::Iterator; diff --git a/formats/energymech/src/lib.rs b/formats/energymech/src/lib.rs index ed687f0..cf9f654 100644 --- a/formats/energymech/src/lib.rs +++ b/formats/energymech/src/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2015 Till Höppner -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #[macro_use] extern crate log; extern crate ilc_base; diff --git a/formats/irssi/src/lib.rs b/formats/irssi/src/lib.rs index 6afcd61..15100f9 100644 --- a/formats/irssi/src/lib.rs +++ b/formats/irssi/src/lib.rs @@ -1,24 +1,10 @@ -// Copyright 2015 Till Höppner -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +use std::io::{BufRead, Write}; +use std::borrow::ToOwned; +use std::iter::Iterator; -use std::io::{ BufRead, Write }; -use std::borrow::{ ToOwned }; -use std::iter::{ Iterator }; - -use event::{ Event, Type, Time }; +use event::{Event, Time, Type}; use context::Context; -use format::{ Encode, Decode, rejoin, strip_one }; +use format::{Decode, Encode, rejoin, strip_one}; use l::LogLevel::Info; @@ -30,7 +16,7 @@ static LINE_FORMAT: &'static str = "%H:%M"; pub struct Iter<'a> { context: &'a Context, input: &'a mut BufRead, - buffer: Vec<u8> + buffer: Vec<u8>, } impl<'a> Iterator for Iter<'a> { @@ -44,15 +30,21 @@ impl<'a> Iterator for Iter<'a> { self.buffer.clear(); match self.input.read_until(b'\n', &mut self.buffer) { Ok(0) | Err(_) => return None, - Ok(_) => () + Ok(_) => (), } let buffer = String::from_utf8_lossy(&self.buffer); let mut split_tokens: Vec<char> = Vec::new(); let tokens = buffer.split(|c: char| { - if c.is_whitespace() { split_tokens.push(c); true } else { false } - }).collect::<Vec<_>>(); + if c.is_whitespace() { + split_tokens.push(c); + true + } else { + false + } + }) + .collect::<Vec<_>>(); if log_enabled!(Info) { info!("Original: `{}`", buffer); @@ -60,145 +52,172 @@ impl<'a> Iterator for Iter<'a> { } match &tokens[..tokens.len() - 1] { - ["---", "Log", "opened", day_of_week, month, day, time, year] => { - year - }, - ["---", "Log", "closed", day_of_week, month, day, time, year] - => return Some(Ok(Event { - ty: Type::Disconnect, - time: parse_time(&self.context, date, time), - channel: self.context.channel.clone().map(Into::into) - })), - [time, "-!-", nick, host, "has", "joined", channel] - => return Some(Ok(Event { - ty: Type::Join { - nick: nick.to_owned().into(), - mask: Some(strip_one(host).into()), - }, - channel: Some(channel.to_owned().into()), - time: parse_time(&self.context, date, time) - })), - [time, "-!-", nick, host, "has", "left", channel, reason..] - => return Some(Ok(Event { - ty: Type::Part { - nick: nick.to_owned().into(), - mask: Some(strip_one(host).into()), - reason: Some(strip_one(&rejoin(reason, &split_tokens[8..])).into()), - }, - channel: Some(channel.to_owned().into()), - time: parse_time(&self.context, date, time) - })), - [time, "-!-", nick, host, "has", "quit", reason..] - => return Some(Ok(Event { - ty: Type::Quit { - nick: nick.to_owned().into(), - mask: Some(strip_one(host).into()), - reason: Some(strip_one(&rejoin(reason, &split_tokens[7..])).into()), - }, - time: parse_time(&self.context, date, time), - channel: self.context.channel.clone().map(Into::into) - })), + ["---", "Log", "opened", day_of_week, month, day, time, year] => year, + ["---", "Log", "closed", day_of_week, month, day, time, year] => { + return Some(Ok(Event { + ty: Type::Disconnect, + time: parse_time(&self.context, date, time), + channel: self.context.channel.clone().map(Into::into), + })) + } + [time, "-!-", nick, host, "has", "joined", channel] => { + return Some(Ok(Event { + ty: Type::Join { + nick: nick.to_owned().into(), + mask: Some(strip_one(host).into()), + }, + channel: Some(channel.to_owned().into()), + time: parse_time(&self.context, date, time), + })) + } + [time, "-!-", nick, host, "has", "left", channel, reason..] => { + return Some(Ok(Event { + ty: Type::Part { + nick: nick.to_owned().into(), + mask: Some(strip_one(host).into()), + reason: Some(strip_one(&rejoin(reason, &split_tokens[8..])).into()), + }, + channel: Some(channel.to_owned().into()), + time: parse_time(&self.context, date, time), + })) + } + [time, "-!-", nick, host, "has", "quit", reason..] => { + return Some(Ok(Event { + ty: Type::Quit { + nick: nick.to_owned().into(), + mask: Some(strip_one(host).into()), + reason: Some(strip_one(&rejoin(reason, &split_tokens[7..])).into()), + }, + time: parse_time(&self.context, date, time), + channel: self.context.channel.clone().map(Into::into), + })) + } // TODO: reorder - [date, time, "--", notice, content..] - if notice.starts_with("Notice(") - => return Some(Ok(Event { - ty: Type::Notice { - from: notice["Notice(".len()..notice.len() - 2].to_owned().into(), - content: rejoin(content, &split_tokens[4..]), - }, - time: parse_time(&self.context, date, time), - channel: self.context.channel.clone().map(Into::into) - })), - [date, time, "--", nick, verb, "now", "known", "as", new_nick] - if verb == "is" || verb == "are" - => return Some(Ok(Event { - ty: Type::Nick { - old_nick: nick.to_owned().into(), - new_nick: new_nick.to_owned().into() - }, - time: parse_time(&self.context, date, time), - channel: self.context.channel.clone().map(Into::into) - })), - [date, time, sp, "*", nick, msg..] - if sp.clone().is_empty() - => return Some(Ok(Event { - ty: Type::Action { - from: nick.to_owned().into(), - content: rejoin(msg, &split_tokens[5..]), - }, - time: parse_time(&self.context, date, time), - channel: self.context.channel.clone().map(Into::into) - })), - [date, time, nick, msg..] - => return Some(Ok(Event { - ty: Type::Msg { - from: nick.to_owned().into(), - content: rejoin(msg, &split_tokens[3..]), - }, - time: parse_time(&self.context, date, time), - channel: self.context.channel.clone().map(Into::into) - })), - _ => () + [date, time, "--", notice, content..] if notice.starts_with("Notice(") => { + return Some(Ok(Event { + ty: Type::Notice { + from: notice["Notice(".len()..notice.len() - 2].to_owned().into(), + content: rejoin(content, &split_tokens[4..]), + }, + time: parse_time(&self.context, date, time), + channel: self.context.channel.clone().map(Into::into), + })) + } + [date, time, "--", nick, verb, "now", "known", "as", new_nick] if verb == "is" || + verb == "are" => { + return Some(Ok(Event { + ty: Type::Nick { + old_nick: nick.to_owned().into(), + new_nick: new_nick.to_owned().into(), + }, + time: parse_time(&self.context, date, time), + channel: self.context.channel.clone().map(Into::into), + })) + } + [date, time, sp, "*", nick, msg..] if sp.clone().is_empty() => { + return Some(Ok(Event { + ty: Type::Action { + from: nick.to_owned().into(), + content: rejoin(msg, &split_tokens[5..]), + }, + time: parse_time(&self.context, date, time), + channel: self.context.channel.clone().map(Into::into), + })) + } + [date, time, nick, msg..] => { + return Some(Ok(Event { + ty: Type::Msg { + from: nick.to_owned().into(), + content: rejoin(msg, &split_tokens[3..]), + }, + time: parse_time(&self.context, date, time), + channel: self.context.channel.clone().map(Into::into), + })) + } + _ => (), } } } } impl Decode for Irssi { - fn decode<'a>(&'a mut self, context: &'a Context, input: &'a mut BufRead) -> Box<Iterator<Item = ::Result<Event<'a>>> + 'a> { + fn decode<'a>(&'a mut self, + context: &'a Context, + input: &'a mut BufRead) + -> Box<Iterator<Item = ::Result<Event<'a>>> + 'a> { Box::new(Iter { context: context, input: input, - buffer: Vec::new() + buffer: Vec::new(), }) } } impl Encode for Irssi { - fn encode<'a>(&'a self, context: &'a Context, mut output: &'a mut Write, event: &'a Event) -> ::Result<()> { + fn encode<'a>(&'a self, + context: &'a Context, + mut output: &'a mut Write, + event: &'a Event) + -> ::Result<()> { match event { &Event { ty: Type::Msg { ref from, ref content, .. }, ref time, .. } => { - try!(writeln!(&mut output, "{}\t{}\t{}", - time.with_format(&context.timezone, TIME_DATE_FORMAT), from, content)) - }, + try!(writeln!(&mut output, + "{}\t{}\t{}", + time.with_format(&context.timezone, TIME_DATE_FORMAT), + from, + content)) + } &Event { ty: Type::Action { ref from, ref content, .. }, ref time, .. } => { - try!(writeln!(&mut output, "{}\t *\t{} {}", - time.with_format(&context.timezone, TIME_DATE_FORMAT), from, content)) - }, + try!(writeln!(&mut output, + "{}\t *\t{} {}", + time.with_format(&context.timezone, TIME_DATE_FORMAT), + from, + content)) + } &Event { ty: Type::Join { ref nick, ref mask, .. }, ref channel, ref time } => { - try!(writeln!(&mut output, "{}\t-->\t{} ({}) has joined {}", - time.with_format(&context.timezone, TIME_DATE_FORMAT), nick, - mask.as_ref().expect("Hostmask not present, but required."), - channel.as_ref().expect("Channel not present, but required."))) - }, + try!(writeln!(&mut output, + "{}\t-->\t{} ({}) has joined {}", + time.with_format(&context.timezone, TIME_DATE_FORMAT), + nick, + mask.as_ref().expect("Hostmask not present, but required."), + channel.as_ref().expect("Channel not present, but required."))) + } &Event { ty: Type::Part { ref nick, ref mask, ref reason }, ref channel, ref time } => { - try!(write!(&mut output, "{}\t<--\t{} ({}) has left {}", - time.with_format(&context.timezone, TIME_DATE_FORMAT), nick, - mask.as_ref().expect("Hostmask not present, but required."), - channel.as_ref().expect("Channel not present, but required."))); + try!(write!(&mut output, + "{}\t<--\t{} ({}) has left {}", + time.with_format(&context.timezone, TIME_DATE_FORMAT), + nick, + mask.as_ref().expect("Hostmask not present, but required."), + channel.as_ref().expect("Channel not present, but required."))); if reason.is_some() && reason.as_ref().unwrap().len() > 0 { try!(write!(&mut output, " ({})", reason.as_ref().unwrap())); } try!(write!(&mut output, "\n")) - }, + } &Event { ty: Type::Quit { ref nick, ref mask, ref reason }, ref time, .. } => { - try!(write!(&mut output, "{}\t<--\t{} ({}) has quit", - time.with_format(&context.timezone, TIME_DATE_FORMAT), nick, - mask.as_ref().expect("Hostmask not present, but required."))); + try!(write!(&mut output, + "{}\t<--\t{} ({}) has quit", + time.with_format(&context.timezone, TIME_DATE_FORMAT), + nick, + mask.as_ref().expect("Hostmask not present, but required."))); if reason.is_some() && reason.as_ref().unwrap().len() > 0 { try!(write!(&mut output, " ({})", reason.as_ref().unwrap())); } try!(write!(&mut output, "\n")) - }, + } &Event { ty: Type::Disconnect, ref time, .. } => { - try!(writeln!(&mut output, "{}\t--\tirc: disconnected from server", - time.with_format(&context.timezone, TIME_DATE_FORMAT))) - }, + try!(writeln!(&mut output, + "{}\t--\tirc: disconnected from server", + time.with_format(&context.timezone, TIME_DATE_FORMAT))) + } &Event { ty: Type::Notice { ref from, ref content }, ref time, .. } => { - try!(writeln!(&mut output, "{}\t--\tNotice({}): {}", - time.with_format(&context.timezone, TIME_DATE_FORMAT), from, content)) - }, - _ => () + try!(writeln!(&mut output, + "{}\t--\tNotice({}): {}", + time.with_format(&context.timezone, TIME_DATE_FORMAT), + from, + content)) + } + _ => (), } Ok(()) } diff --git a/formats/msgpack/src/lib.rs b/formats/msgpack/src/lib.rs index 36af1aa..6d041b8 100644 --- a/formats/msgpack/src/lib.rs +++ b/formats/msgpack/src/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2015 Till Höppner -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - use std::io::{BufRead, Write}; use std::iter::Iterator; diff --git a/formats/weechat/src/lib.rs b/formats/weechat/src/lib.rs index 4e1bd42..7d9eb3d 100644 --- a/formats/weechat/src/lib.rs +++ b/formats/weechat/src/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2015 Till Höppner -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #[macro_use] extern crate log; extern crate ilc_base; diff --git a/ops/Cargo.toml b/ops/Cargo.toml index 9a31871..f4bf082 100644 --- a/ops/Cargo.toml +++ b/ops/Cargo.toml @@ -12,3 +12,4 @@ log = "0.3.5" ilc-base = "~0.2" blist = "0.0.4" bit-set = "0.3.0" +serde = "~0.7" diff --git a/ops/src/freq.rs b/ops/src/freq.rs deleted file mode 100644 index 4a02d4c..0000000 --- a/ops/src/freq.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! Per-nick word/line statistics - -use ilc_base::{self, Context, Decode, Event}; -use ilc_base::event::Type; - -use std::collections::HashMap; -use std::io::{BufRead, Write}; - -struct Person { - lines: u32, - alpha_lines: u32, - words: u32, -} - -fn words_alpha(s: &str) -> (u32, bool) { - let mut alpha = false; - let mut words = 0; - for w in s.split_whitespace() { - if !w.is_empty() { - words += 1; - if w.chars().any(char::is_alphabetic) { - alpha = true - } - } - } - (words, alpha) -} - -fn strip_nick_prefix(s: &str) -> &str { - if s.is_empty() { - return s; - } - match s.as_bytes()[0] { - b'~' | b'&' | b'@' | b'%' | b'+' => &s[1..], - _ => s, - } -} - -// TODO: Don't print results, return Stats struct -/// Return the `count` most active nicks, with lines, words and words per lines calculated. -/// -/// `usize::MAX` is a good default if you don't want to cap the statistics. -pub fn freq(count: usize, - ctx: &Context, - input: &mut BufRead, - decoder: &mut Decode, - output: &mut Write) - -> ilc_base::Result<()> { - let mut stats: HashMap<String, Person> = HashMap::new(); - - for e in decoder.decode(&ctx, input) { - let m = try!(e); - match m { - Event { ty: Type::Msg { ref from, ref content, .. }, .. } => { - let nick = strip_nick_prefix(from); - if stats.contains_key(nick) { - let p: &mut Person = stats.get_mut(nick).unwrap(); - let (words, alpha) = words_alpha(content); - p.lines += 1; - if alpha { - p.alpha_lines += 1 - } - p.words += words; - } else { - let (words, alpha) = words_alpha(content); - stats.insert(nick.to_owned(), - Person { - lines: 1, - alpha_lines: if alpha { 1 } else { 0 }, - words: words, - }); - } - } - _ => (), - } - } - - let mut stats: Vec<(String, Person)> = stats.into_iter().collect(); - stats.sort_by(|&(_, ref a), &(_, ref b)| b.words.cmp(&a.words)); - - for &(ref name, ref stat) in stats.iter().take(count) { - try!(write!(output, - "{}:\n\tTotal lines: {}\n\tLines without alphabetic characters: {}\n\tTotal \ - words: {}\n\tWords per line: {}\n", - name, - stat.lines, - stat.lines - stat.alpha_lines, - stat.words, - stat.words as f32 / stat.lines as f32)); - } - Ok(()) -} diff --git a/ops/src/lib.rs b/ops/src/lib.rs index f148037..d5aa003 100644 --- a/ops/src/lib.rs +++ b/ops/src/lib.rs @@ -2,10 +2,11 @@ extern crate log; extern crate blist; extern crate bit_set; +extern crate serde; extern crate ilc_base; mod ageset; -pub mod freq; +pub mod stats; /// No-op log parsing pub mod parse { @@ -219,7 +220,9 @@ pub mod merge { // Keep non-empty streams for (offset, idx) in empty.iter().enumerate() { - events.remove(offset + idx); + // `remove` returns an iterator. It's empty, but Rust doesn't know that, + // so suppress the warning like this. + let _ = events.remove(offset + idx); } empty.clear(); } diff --git a/ops/src/stats.rs b/ops/src/stats.rs new file mode 100644 index 0000000..49f4068 --- /dev/null +++ b/ops/src/stats.rs @@ -0,0 +1,123 @@ +//! Per-nick word/line statistics + +use ilc_base::{self, Context, Decode, Event}; +use ilc_base::event::Type; + +use std::collections::HashMap; +use std::io::BufRead; + +use serde::ser::{MapVisitor, Serialize, Serializer}; + +pub struct Stats { + pub freqs: HashMap<String, NickStat>, +} + +impl Serialize for Stats { + fn serialize<S>(&self, s: &mut S) -> Result<(), S::Error> + where S: Serializer + { + struct Visitor<'a>(&'a Stats); + impl<'a> MapVisitor for Visitor<'a> { + fn visit<S>(&mut self, s: &mut S) -> Result<Option<()>, S::Error> + where S: Serializer + { + try!(s.serialize_struct_elt("freqs", &self.0.freqs)); + Ok(None) + } + + fn len(&self) -> Option<usize> { + Some(1) + } + } + s.serialize_struct("Stats", Visitor(self)) + } +} + +pub struct NickStat { + pub lines: u32, + pub alpha_lines: u32, + pub words: u32, +} + +impl Serialize for NickStat { + fn serialize<S>(&self, s: &mut S) -> Result<(), S::Error> + where S: Serializer + { + struct Visitor<'a>(&'a NickStat); + impl<'a> MapVisitor for Visitor<'a> { + fn visit<S>(&mut self, s: &mut S) -> Result<Option<()>, S::Error> + where S: Serializer + { + try!(s.serialize_struct_elt("lines", self.0.lines)); + try!(s.serialize_struct_elt("alpha_lines", self.0.alpha_lines)); + try!(s.serialize_struct_elt("words", self.0.words)); + Ok(None) + } + + fn len(&self) -> Option<usize> { + Some(3) + } + } + + s.serialize_struct("NickStat", Visitor(self)) + } +} + +fn words_alpha(s: &str) -> (u32, bool) { + let mut alpha = false; + let mut words = 0; + for w in s.split_whitespace() { + if !w.is_empty() { + words += 1; + if w.chars().any(char::is_alphabetic) { + alpha = true + } + } + } + (words, alpha) +} + +fn strip_nick(s: &str) -> &str { + if s.is_empty() { + return s; + } + match s.as_bytes()[0] { + b'~' | b'&' | b'@' | b'%' | b'+' => &s[1..], + _ => s, + } + .trim_right_matches('_') +} + +/// Return all active nicks, with lines, words and words per lines counted. +pub fn stats(ctx: &Context, input: &mut BufRead, decoder: &mut Decode) -> ilc_base::Result<Stats> { + let mut freqs: HashMap<String, NickStat> = HashMap::new(); + + for e in decoder.decode(&ctx, input) { + let m = try!(e); + match m { + Event { ty: Type::Msg { ref from, ref content, .. }, .. } => { + let nick = strip_nick(from); + if freqs.contains_key(nick) { + let p: &mut NickStat = freqs.get_mut(nick).unwrap(); + let (words, alpha) = words_alpha(content); + p.lines += 1; + if alpha { + p.alpha_lines += 1 + } + p.words += words; + } else { + let (words, alpha) = words_alpha(content); + freqs.insert(nick.to_owned(), + NickStat { + lines: 1, + alpha_lines: if alpha { 1 } else { 0 }, + words: words, + }); + } + } + _ => (), + } + } + + Ok(Stats { freqs: freqs }) +} @@ -6,16 +6,15 @@ extern crate ilc_format_weechat; extern crate ilc_format_energymech; pub use ilc_base::{Context, Decode, Encode, Event, context, dummy, error, event, format}; -pub use ilc_ops::{convert, dedup, freq, parse, seen, sort}; - pub use ilc_cli::{decoder, encoder, force_decoder, force_encoder, open_files}; -pub use ilc_ops::convert::convert; -pub use ilc_ops::dedup::dedup; -pub use ilc_ops::freq::freq; -pub use ilc_ops::parse::parse; -pub use ilc_ops::seen::seen; -pub use ilc_ops::sort::sort; +pub use ilc_ops::convert::{self, convert}; +pub use ilc_ops::dedup::{self, dedup}; +pub use ilc_ops::stats::{self, stats}; +pub use ilc_ops::parse::{self, parse}; +pub use ilc_ops::seen::{self, seen}; +pub use ilc_ops::sort::{self, sort}; +pub use ilc_ops::merge::{self, merge}; pub use ilc_format_weechat::Weechat; pub use ilc_format_energymech::Energymech; diff --git a/src/main.rs b/src/main.rs index 3371a9f..0cdab68 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,12 @@ extern crate ilc_cli; +use ilc_cli::Cli; + +static MASTER: &'static str = include_str!("../.git/refs/heads/master"); + fn main() { - ilc_cli::main(); + ilc_cli::main(Cli { + version: env!("CARGO_PKG_VERSION").into(), + master_hash: MASTER.trim_right().into(), + }); } diff --git a/warning.rs b/warning.rs new file mode 100644 index 0000000..a71bc3f --- /dev/null +++ b/warning.rs @@ -0,0 +1,11 @@ +use std::iter; + +fn main() { + let mut v = (0..20) + .map(|_| iter::empty::<()>()) + .collect::<Vec<_>>(); + + for i in 1..8 { + v.remove(i + 1); + } +} |